MJSCHMEL@pucc.UUCP (03/03/88)
Okay. Now we're getting into some real use of strings.
You can't do an app without menus, and I'm stuck, MPW
wise. (LSC, all I had to do was "\pFile", "\pQuit/Q"
and so on.)
Here's what don't work...
Initialize()
{
char buffer[255];
register MenuHandle m;
/* The apple and File menu don't work either
*
*
*/
strcpy (buffer, "Edit");
c2pstr(buffer);
DebugStr(buffer); /* works: debugger says EDIT */
m = NewMenu(EditID, buffer);
strcpy (buffer, "Undo/Z");
c2pstr(buffer);
DebugStr(buffer); /* works: debugger says UNDO/Z */
AppendMenu(m, buffer);
strcpy (buffer, "(-");
/*
* and so on..
*/
I get nonsensical strings in the menu bar reminiscent of
some bad experiences I've had with strings in my early C
career. (I'm not _still_ writing bad C, am I???) Of course,
it's then just a matter of clicking somewhere to drop into
the debugger _involuntarily_.
Any insights here would be appreciated.
I guess my question could be most succinctly put like this:
How do you do menus from code in MPW C? (As opposed to getting
menus from a resource.)
Has there been a MacTutor article on the diffs between LSC
and MPW C, covering the difficulties in porting one to the
other? (It sure turned out harder than I expected.)
THANK GOD FOR COMP.SYS.MAC.PROGRAMMER!
(I'll stop snivelling now.)
==============================================================================
comes around Mike Schmelzer MJSCHMEL@PUCC.Princeton.Edu what goes around
==============================================================================