jerry@uwm-cs.UUCP (Jerry Lieberthal) (12/22/87)
I just received my copy of LSC, version 2.13, and the requisite copies of Inside Mac, plus the intro text USING THE MAC TOOLBOX WITH C. Tried my first program, and natch, it didn't work. The problem seems to be the way I have my window defined... I've stared and stared at the code, but I can't seem to find the problem (it's probably very simple). The code (most of it taken from the TOOLBOX example): WindowRecord myWindowRec ; WindowPtr myWindow, whichwindow ; Rect bounds ; char title ; EventRecord event ; short where ; InitGraf (&thePort) ; InitWindows () ; InitFonts () ; InitMenus () ; FlushEvents (everyEvent, 0) ; SetRect (&bounds, 50, 50, 400, 200) ; /* is this off the screen, really?*/ title = "untitled" ; myWindow = NewWindow (&myWIndowRec, &bounds, CtoPstr (title), TRUE, 0, (WindowPtr) - 1, TRUE, 0) ; SetPort (myWindow) ; /* not sure this is necessary */ DrawGrowIcon (myWindow) ; InitCursor () ; while (TRUE) { if (GetNExtEvent (everyEvent, &event)) switch (event.what) { case keyDown: ... case mouseDown: ... more stuff related to other cases ... I don't seem to ever be able to click in the window contents, title bar, etc. Even though I can see the window, it doesn't seem to be active... What gives???? - jerry@csd4.milw.wisc.edu ihnp4!uwmcsd4!jerry