Help with Macintosh programming

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

Archive for August, 2011

Platonic solids?

Can someone point me to any open-source code to plot platonic solids?
For what I’m doing, I just need to generate the polar coordinates of
their vertices in the unit sphere.

-jcr

.
posted by admin in Uncategorized and have Comments (3)

Show Info Apple Event in OS X

I have a C++ Carbon app. In Mac OS 9 I can send a
(kAEFinderEvents,kAEGetInfoSelection) Apple Event to The Finder to open
the Get Info dialog for a file. In OS X, this does not work (The Finder
does nothing). Anyone know what Apple Event to send to The Finder in OS
X to display the "Show Info" dialog?

Thanks

Steve

posted by admin in Uncategorized and have Comments (5)

Autoindentation in PB?

Is there a help app or function that’ll give me autoindention in a PB
file? I’m too lazy to add them by hand.

I remember back when I was student we used an app called "nice" that
indented program files and made all procedure titles boldface. B)

C Lund, Oslo
http://www.notam02.no/~clund/

posted by admin in Uncategorized and have Comments (3)

Link error IUMagPString (One more time)

I did not get any replies last time, so I’m trying again:

I’m getting this link error when compiling using the LString class:
Link Error    : undefined ‘IUMagPString’ (code)
Referenced from ‘LString::ToolBoxCompareText(const void*, const void*,
unsigned char)’ in LString.cp

Doing some research, I find that IUMagPString is not supported under
Carbonlib, so what changes do I need to my project or source files to
get around this?
Thanks

posted by admin in Uncategorized and have No Comments

Can I create a Mac icon without using a Mac?

Hello to all of you,

I’m currently putting together a Hybrid CD that will work on both Mac as
well as on Linux and MS-Windows. I solved nearly all problems thanks to
the "mkisofs" program, except for one: How do I create a Mac icon
without working at a Mac computer and drawing it? I can do some short
tests on another person’s Mac but it doesn’t have internet access, and
also I cannot use it for some long drawing session.

Is there any non-Mac software that can output a Mac icon file, in
MacBinary or BinHex format or so? The rest should be easy as I see it:
Call the file "Icon\r" and put it into the CD’s root folder.

Any help would be greatly appreciated, and please forgive me for posting
to two groups, but I didn’t know which one would be more appropriate.

Linards Ticmanis

 The Master said, "The business of laying on the colors follows the
preparation of the plain ground."

posted by admin in Uncategorized and have Comments (5)

ScriptEditor madness

I am going insane trying to work on an AppleScript dictionary for an
application.  For some reason, someone is caching older versions of the
dictionary and no matter how often I relaunch script editor, it keeps
the stale data around.  Searching in the Preferences folder yields
nothing.  OS 9.1 FWIW.

Anyone know how to make this damn thing look at the application?

TIA,

- rmgw

<http://www.trustedmedianetworks.com/>

—————————————————————————-
Richard Wesley                                  Trusted Media Networks, Inc.

"I found it at the bottom of a locked filing cabinet, in a disused
 lavatory with a sign on the door saying ‘Beware of the leopard.’"
          – Douglas Adams, _The Hitchhiker’s Guide to the Galaxy_

posted by admin in Uncategorized and have Comments (3)

Help: Carbon file still no-go

Hi,

I’m trying to open the file "DATA.DAT" which lives in the same folder as the application. I’ve use some sample code from the Technical Q&A FL14 article but I keep getting a -43 error at FSMakeFSSpec. It’s a PB project, nib based.

Any help appreciated.

Thanks,

Paul
===============================

    PSN.highLongOfPSN = 0;
   PSN.lowLongOfPSN = kCurrentProcess;
       /* set up info block */
   pinfo.processInfoLength = sizeof(pinfo);
   pinfo.processName = NULL;
   pinfo.processAppSpec = &pspec;
       /* grab the vrefnum and directory */
   err = GetProcessInformation(&PSN, &pinfo);
   if(err == noErr)
        err = FSMakeFSSpec(pspec.vRefNum, pspec.parID, "\pDATA.DAT", &pspec);

    if(err == noErr)
        err = FSpOpenDF(&pspec, fsRdPerm, &fref);

=================================

posted by admin in Uncategorized and have Comments (5)

Shared Memory in OS-X

I am working on getting a small test program into shape to replace code that
uses shared memory on a Windows machine. There are two threads which need to
communicate through shared memory. I’ve tried to implement the code using the
Unix shared memory routines. (in <sys/shm.h>) I’ve got code that appears to
work – i.e., return codes are correct but changing the memory in one thread
doesn’t appear to affect the memory in the other thread. The specific calls
that I am making are shmget (et. al.).

Any assistance would be appreciated. I’d post the code if I had it with me
tonight. Tomorrow I will probably add it in. Thanks.

- David

posted by admin in Uncategorized and have Comments (2)

How to stave off the screensaver

Anyone know how I can prevent the OS X screensaver from starting? I
don’t want to turn it off. I just want to reset whatever timer OS X
uses to keep track of the last time a user interacted with the
computer.

Our product, the SMART Board (www.smarttech.com), lets the user
interact with the computer without the mouse or keyboard and it’s a
little annoying when the screensaver suddenly pops up in the middle of
your drawing.

Thanks for reading.

Corey Nelson

posted by admin in Uncategorized and have Comment (1)

Faceless background app in Carbon revisited

I’ve made a little more progress with this thanks to the advice I
got here, and discovered the following:

As Meeroh suggested, you don’t need a ‘plst’ resource in a CFM
FBA.  The reason why mine didn’t work was that I had the SIZE
resource ID at 128.  Once I made that -1 instead, I found that
double-clicking the app caused it to start up and disappear into
the background as it should, with no icon in the Dock.

However, when it was started from the main app using LaunchApplication,
it launched in the foreground.  Eventually I discovered the
launchDontSwitch flag, and using that in the LaunchParamBlockRec
made it launch in the background.  However, its icon is still
installed in the Dock.

So, my final question is, is there a way of launching the app in
the way that the Finder does, with no icon installed in the Dock?
Is there some other flag I can use in the LaunchParamBlockRec
to get this, or should I perhaps be telling the Finder to do
the launching (send an odoc event to the Finder?).

If you’re curious as to why I’m trying to do this, it’s a workaround
for a bug in OS X 10.1 which makes Classic apps unable to play
music using Quicktime Musical Instruments.  The problem does not
apply to Carbon apps, so in the long run I should carbonise my
main application.  This ain’t easy though because it is linked
to a library written in 68K assembler, and that’s a lot of code
to re-write.  In the short term I can fix the problem by passing
the Quicktime tune to my Carbon FBA, which then submits it to
Quicktime.  This is all working nicely now apart from the FBA’s
icon appearing in the Dock.

Phil Taylor

a a r 0 9 @ d i a l . p i p e x . c o m

posted by admin in Uncategorized and have Comments (2)