Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uwm.edu!uakari.primate.wisc.edu!caesar.cs.montana.edu!ogicse!decwrl!shlump.nac.dec.com!decuac!mountn.dec.com!minow From: minow@mountn.dec.com (Martin Minow) Newsgroups: comp.sys.mac.programmer Subject: Re: Window Zooming Message-ID: <1329@mountn.dec.com> Date: 4 Feb 90 02:07:43 GMT References: <1453@raybed2.UUCP> <5544@hydra.gatech.EDU> <10003@hoptoad.uucp> Reply-To: minow@thundr.enet.dec.com (Martin Minow) Organization: Digital Equipment Corporation Lines: 40 lef@raybed2.UUCP (Lee Fyock) asks how to handle window zoom events. Here's a code fragment. I don't remember where I copied it from (possibly "How to Write Macintosh Software"): void do_mouse() { WindowPtr the_window; int partcode; partcode = FindWindow(event.where, &the_window); switch (partcode) { ... other cases here ... case inZoomIn: case inZoomOut: if (TrackBox(the_window, event.where, partcode)) { GrafPtr save_port; GetPort(&save_port); SetPort(the_window); EraseRect(&the_window->portRect); ZoomWindow(the_window, partcode, FALSE); InvalRect(&the_window->portRect); /* * Do all the window specific things that are size-dependent, * such as LSize. */ DrawGrowIcon(the_window); SetPort(save_port); } break; It may possible to be more clever so you don't repaint the entire screen when you change the window's size. Also, I'm not certain whether the GetPort/SetPort stuff is really needed. Hope this helps. Martin Minow minow@thundr.enet.dec.com