Help with Macintosh programming

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

Archive for August, 2010

my shared lib doesnt work on other comps?

Anyone know why my application will not load the shared library I have
created on other computers?  It works just fine on mine…

I have it in the same folder as the application, and it works on mine, but
not any other computer I’ve tried…  Thanks,

    Dylan Barrie

posted by admin in Uncategorized and have Comments (3)

Scroll Wheel evnts ?

It is possible for a non-Cocoa (Carbon) app to receive events from
scroll wheels ?  How ?

posted by admin in Uncategorized and have Comment (1)

Accessing Flattened Resource Files

How do I open a flattened resource file so that the Resource Map is loaded
like when traditionally opening a normal resource file with
FSpOpenRezFile(). By flattened resorce file, I mean a file where all the
information normally stored in the resource fork has been moved to the
data fork.

This is for a Mac OS X only app. I already have the main resource file
flattened in the resource folder of my .app package, and the OS opens that
up just fine on it’s own.


posted by admin in Uncategorized and have Comments (4)

Dumb newbie's Ptr problem


I have read a file into a Ptr and need to access the data as short ints.

    Ptr pBuf;
    pBuf = NewPtr(bytes);

    // read file into pBuf

    // access a short int
    short *a,b;

    a = (short*)pBuf;
    b = *a;

    // stick the changed ‘b’ back into pBuf
    *pBuff = something or other??

‘b’ contains the number as I expect when read from pBuf. But I want "b+=2"
and then to stick it back into the buf – what do I do? pBuf seems to be
expecting char’s and I can’t seem to put short ints into it. I’ve tried all
sorts of type casting but it’s no go.

Any help appreciated.


posted by admin in Uncategorized and have Comments (2)

Lisp for the Mac

Has anybody got experience with the free Lisp implementation "Power
Lisp" for the Mac?

I’d like to learn Lisp (maybe it is a good idea to have a "functional
language" at my disposal).

I was a little bit depressed by the high prices for the commercial

I saw that the update of PowerLisp has been burried. The author jumped
to Windows platform in 1998.

Are there any problems with PowerLisp and System 9? Or would it be
better to use Scheme in order to learning Lisp?

Why isn’t Apple releasing to C/C++ a free Lisp version? I have imagined
that Lisp had been a good tradition on the Mac platform. Or do I miss

S. Gonzi

posted by admin in Uncategorized and have Comments (3)

Advanced List Manager help needed

Problem: I am not getting any response to mouse events over the List’s Scrollbar.

Context: the List is instantiated on a Window, not a Dialog. The user has
the ability to move it around on the Window and to re-size it. Dragging
on the text area causes a select rect to be drawn which followd the mouse.
The Scrollbar thumb also changes position when needed, although dragging
off the top or bottom of the control response is so fast I cannot observe
any incremental motion. The Window can also be re-sized, will produce its
own Scrollbars when there is content outside its Rect, and all controls
including my List move around as the Window is scrolled with no problems.

Clicking on any part of the Scrollbar has no effect. From the selection
rect behaviour and breakpoint inspection I know the Event co-ordinates
are being properly passed to LClick, and LClick _is_ called when the
mouse-down was over a Scrollbar arrow. A double-click over the text gets me
the correct cell number.

I have a couple of other problems associated with the user mobility of
the control. The example code I have found is all either on a dialog or filling
a Window; none of them allow for moving or re-sizing the control. I have
found that I have to manually move the rView topleft, and call LSize,
to get the contents and Scrollbar to draw in the correct positions.
Is there something else I have to change so the LDEF knows the mouse-down
is in fact over the Scrollbar? The control is _never_ created in its final
position because of the mobility aspects of the design. I noticed that
several aspects of the control were based on the initial 0,0 coordinates
until I added the move/size code. And when I copied the control (one of
my operations) the new control appears initially on the other Window in
the same offset as its original, even though my code does not copy that attribute.
It seems the LDEF has some globals.

I have several other types of control working perfectly, including Waste Editor
and some fully custom ones. All are coded in C using Code Warrior 5.3.
I do not use C++ or PowerPlant.

I would really appreciate some help on this. If you have some ideas, please
e-mail me directly.

Many thanks,

Dave Warman
Warman’s First Law:
     Everything that can be configured, must be
         Defaults aren’t

posted by admin in Uncategorized and have No Comments

Carbon Handle Question

If I call a Carbon accessor function that returns a handle, do I have to
despose that handle after I’m done with it?

posted by admin in Uncategorized and have Comments (3)

password for root user


After I install the Mac OS X and create the account for administrator.
But when I open the Terminal and try to change user to root

%su root

I don’t know the password for root user. How to know the password for
root user ?

The Mac OS X is from ADC.

Thanks !

posted by admin in Uncategorized and have Comments (2)

QuickTime on Windows

Apologies if this is the wrong forum – there is no appropriate PC
group as far as I can tell…

I have to create an Windows app that supports Quicktime fileformats –
specifically, taking the frame data and processing it in real time.

I have it working for mov/avi files but the MPEG support in version 5
seems *really* sluggish – something like 10% of the speed of a
similarly sized movie in MOV format, not to mention a long delay when
the file is opened.

I haven’t recompiled anything yet with v5 of the SDK since it doesn’t
seem to be available for PC yet.

Are there other calls I need to make to get MPEG playback to work

Any help appreciated.


posted by admin in Uncategorized and have No Comments

Scaling UI element

I would like to draw a user interface element and then enlarge it to display
it (this user pane will contain text and possibly images). Is there any
calls to do that?


posted by admin in Uncategorized and have Comments (3)