jdm@ut-ngp.UUCP (Jim Meiss) (11/18/86)
I am a novitiate both to C and to MacIntosh programing, so please pardon the question if it turns out to be trivial. I would like to implement the zoom box on a window using Lightspeed C v. 1.02 on a MacPlus. According to Tech Note #57 (the only thing I have seen written on the subject) one defines a window of type 8. This indeed gives the zoombox in the window. Next I used the enclosed code fragment to try to get the zoom. My window that zooms out okay, but will not zoom in. How come??? Perhaps my problem is in the definition of the functions TrackBox and ZoomWindow... Another question: Is it possible to set the size that the window zooms to? ------------------------------------- /* Code Fragment for Zoom Windows */ enum { inDesk, inMenuBar, inSysWindow, inContent, inDrag, inGrow, inGoAway, inZoomIn, inZoomOut }; . . pascal Boolean *TrackBox() = 0xA83B; pascal void *ZoomWindow() = 0xA83A; . . . main() { WindowPtr whichWindow; EventRecord myEvent; InitGraf(&thePort); InitFonts(); InitWindows(); InitMenus(); TEInit(); for(;;) /* forever */ { SystemTask(); if (GetNextEvent(everyEvent, &myEvent)) { switch(myEvent.what) { case mouseDown: switch (FindWindow( myEvent.where, &whichWindow )) { . . case inZoomIn: if(TrackBox(whichWindow,myEvent.where,inZoomIn)) ZoomWindow(whichWindow,inZoomOut,0); break; case inZoomOut: if(TrackBox(whichWindow,myEvent.where,inZoomOut)) ZoomWindow(whichWindow,inZoomOut,0); break; default: break; } /* end switch findwindow */ break; . . default: break; } /* end switch which event */ . . } /* end if event */ } /* end forever */ } /* end main */ -------------------------------------] Thanks for your help, Jim Meiss ut-npg!jdm
dgold@apple.UUCP (David Goldsmith) (11/18/86)
In your call to ZoomWindow for the inZoomIn case, you are passing the partcode inZoomOut, thus telling it to zoom out (which it already is). -- David Goldsmith Apple Computer, Inc. MacApp Group AppleLink: GOLDSMITH1 UUCP: {nsc,dual,sun,voder,ucbvax!mtxinu}!apple!dgold CSNET: dgold@apple.CSNET, dgold%apple@CSNET-RELAY