Help with Macintosh programming

macintosh programming, mac programming, mac os programming, mac os x programming, mac programming language, mac programing

Archive for October, 2010

Where are the scrollbars of the standard Scrolling Text Box???

Hi!

Have anyone ever happen to see the vertical Scroll Bar of a
Scrolling Standard Text Box?

ProcID or Control Definition ID = 432
Var Code = 0

I have used ResEdit to create it but it doesn’t
show the vertical scroll bars. Not even show itself???

Could anyone help please?

Best Regards,
Giovanni

.
posted by admin in Uncategorized and have No Comments

newbie OS X question

Hello, all!

I’m relatively new to the Mac world.  I’ve always known the Mac was a better
architecture than the PC, but I’m more of a Unix guy…

Anyway, I am now doing some contract work for a company that has a mac only
product, but only for OS9.  They need to make drivers for OSX, but no one
there is used to working with Unix-like systems.  So, that will be one of my
new tasks.

They’ve said that getting info from Mac is like pulling the teeth out of a
chicken, so I’m wondering if anyone here knows where I can get off-the-shelf
books that will fill me in on the details of working with OSX.

Is it a straight BSD system as far as devices go?

Thanks for any and all help!

-Michael


Reply address is completely bogus.  The real address is:
        GEORGE <at symbol> MINTCITY <dot> COM
but in lowercase, not UPPERCASE

No, my friend, the way to have good and safe government, is not to trust it
all to one, but to divide it among the many, distributing to every one exactly
the functions he is competent to.  It is by dividing and subdividing these
republics from the national one down through all its subordinations, until it
ends in the administration of every man’s farm by himself; by placing under
every one what his own eye may superintend, that all will be done for the
best.
                — Thomas Jefferson, to Joseph Cabell, 1816

posted by admin in Uncategorized and have Comments (3)

X Server Applications under Mac OS X

I  wanted to write a cross platform program that uses the FOX
www.fox-toolkit.org  GUI library.

As far as i know this is ported to MacOS X but only as a X Server
application. This is not a problem for me or my customers but i would
like to know if there is an X Server installed by default under MacOSX
And can a application started in a normal way (with the exception that
it looks very unnormal under Aqua).

I have no Mac computer on my desktop at the moment so i can’t test it.
I must buy one when i start my project.

Thank you very much.

posted by admin in Uncategorized and have Comment (1)

Is there a unix c compiler in/for OS-X

Is "cc" or something equivalent available for OS-X ?

Henk Eskes

posted by admin in Uncategorized and have Comments (6)

Why is my StillDown patch not working?

I am trying to use PatchMaker to create an INIT that patches a
couple of traps.  It seems to work on some traps, but I have not
been able to patch StillDown.  Here is the code I am using and
compiling with CodeWarrior.  The SysBeep() call after patching
does get called.  However, after that, my explicit calls to StillDown
don’t seem to result in the SysBeep in myStillDown getting called.

Anyone have any thoughts as to why this would not be working?

ProcInfoType __procinfo =  kPascalStackBased;
pascal void main(void)
{
    RoutineDescriptorPtr originaldesc, newdesc, unImplimentedTrapAddr;
    UInt32 size;
    UInt16 index;
    THz theZone;
    OSErr err;
    int i;

    // get globals
    EnterCodeResource();
    // detach ourselves
    DetachResource(Get1Resource(‘INIT’, 0));

    // make sure we are in the system heap
    theZone = GetZone();
    SetZone(SystemZone());

    unImplimentedTrapAddr = NGetTrapAddress(_Unimplemented, (_Unimplemented & 0×0800) ? ToolTrap : OSTrap);
    originaldesc = NGetTrapAddress(_StillDown, (_StillDown & 0×0800) ? ToolTrap : OSTrap);
    if (originaldesc != unImplimentedTrapAddr) {
        if (originaldesc->goMixedModeTrap != _MixedModeMagic) {
            // Trap is 68K
            size = sizeof(RoutineDescriptor) + (sizeof(RoutineRecord) * 0);
            // allocate new descriptor
            newdesc = (RoutineDescriptorPtr) NewPtrSys(size);
            if (!newdesc) {
                Debugger();
                return;
            }
            // set fields of routine decscriptor
            newdesc->goMixedModeTrap = _MixedModeMagic;
            newdesc->version = 7;
            newdesc->routineDescriptorFlags = 0;
            newdesc->reserved1 = 0;
            newdesc->reserved2 = 0;
            newdesc->selectorInfo = 0;
            newdesc->routineCount = 0;
            index = 0;
            gOriginalStillDown = originaldesc;
            newdesc->routineRecords[index].procInfo = uppStillDownProcInfo;
            newdesc->routineRecords[index].reserved1 = 0;
            newdesc->routineRecords[index].ISA = GetCurrentArchitecture();
            newdesc->routineRecords[index].routineFlags = 4;
            newdesc->routineRecords[index].procDescriptor = (ProcPtr)myStillDownPatch;
            newdesc->routineRecords[index].reserved2 = 0;
            newdesc->routineRecords[index].selector = 0;
        }
        else {
            // Trap is PPC
            size = sizeof(RoutineDescriptor) + (sizeof(RoutineRecord) * originaldesc->routineCount);
            newdesc = (RoutineDescriptorPtr) NewPtrSys(size);
            if (!newdesc) {
                DebugStr("\pFailed to allocate RoutineDescriptor");
                return;
            }
            BlockMoveData(originaldesc, newdesc, size);
            gOriginalStillDown = originaldesc;
            index = 0;
            newdesc->routineRecords[index].procDescriptor = (ProcPtr)myStillDownPatch;
            newdesc->routineRecords[index].ISA = GetCurrentArchitecture();
        }
        NSetTrapAddress((UniversalProcPtr) newdesc, _StillDown, (_StillDown & 0×0800) ? ToolTrap : OSTrap);
        // Beep if we got here
        SysBeep(120);
    }

    // Now call StillDown to see is the trap is actually patched
    for (i = 0; i < 10; i++)
    {
        if (StillDown())
        {
            i = i + 1;
            i = i – 1;
        }
    }

    // restore to original heap
    SetZone(theZone);
    // restore globals
    ExitCodeResource();

}

pascal Boolean myStillDownPatch(void)
{
    Boolean result;

    // Get globals
    EnterCodeResource();

    SysBeep(30);

    result = CALL_ZERO_PARAMETER_UPP( gOriginalStillDown, uppStillDownProcInfo);

    // Release globals
    ExitCodeResource();
    return result;

}


Bill Tschumy
Otherwise — Austin, TX
b…@otherwise.com

posted by admin in Uncategorized and have Comment (1)

MPW Link Problem

Hi,
When I try to compile my C code in MPW, I get this error:

### Link: Error: Undefined entry, name: (Error 28) "FMActivateFonts"
  Referenced from: ENTRYPOINT in file: :ActivateFont.c.o
### Link: Errors prevented normal completion.

It sounds like I have missed something easy but I don’t know what! I’ve
included Fonts.h, so that’s not it.

Please help!

posted by admin in Uncategorized and have No Comments

threadmanager's using all my ram!

It happens whenever I call yieldtoanythread, or yieldtothread. As soon
as the thread starts, ‘About This Computer’ in the finder says the
program has
used all of its ram, even when I give it 150MBs and all the thread does is
call printf.

posted by admin in Uncategorized and have Comments (3)

seeing what key was pressed

I need to allow the user to select a shortcut, and i want to display
that shortcut. For example, if the user were to type command-option e,
and want my program to display
"Command-Option-E"
One slight problem though. if theEvent is my eventRecord,
theEvent.message&charCodeMask contains the character as it was typed, ie
in the example above, it would be some weird character, not a plain old
‘E’. How do I get the actual letter that  was pressed back ?

Fred

posted by admin in Uncategorized and have Comment (1)

STL for MPW?

Hi all,

MPW does not seem to come with the STL (standard template library).  Does
anyone know where I can obtain STL libraries which are supported by MPW?

Many thanks,
Martin

posted by admin in Uncategorized and have Comment (1)

Tabs control with only one tab is always disabled – why

The tabs control takes a tab# resource that describe the tabs.

When I create a tabs control with just one tab it is always disabled. If

I have two or more tabs they are both correctly enabled.

I have tried SetControlData with the kControlTabEnabledFlagTag and I can

easily enable and disable all tabs except the first one which remains
disabled.

You can most easily see this behavior if you create a window with a tabs

control in Constructor and use Resorcerer to make a tab# control with
one or more tabs.

Does anyone know a trick that makes the tabs control behave correctly
with just one tab ?

Kent
http://www.snak.com

posted by admin in Uncategorized and have Comment (1)