home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!olivea!spool.mu.edu!sdd.hp.com!uakari.primate.wisc.edu!usenet.coe.montana.edu!news.u.washington.edu!ogicse!qiclab!baer
- From: baer@qiclab.scn.rain.com (Ken Baer)
- Newsgroups: comp.sys.mac.programmer
- Subject: Problems with GrowWindow().
- Message-ID: <1992Sep15.193548.1859@qiclab.scn.rain.com>
- Date: 15 Sep 92 19:35:48 GMT
- Organization: SCN Research/Qic Laboratories of Tigard, Oregon.
- Lines: 52
-
-
- I have a mysterious problem with the toolbox GrowWindow() call. When I click
- on the window's growbox, I don't get an Xor'd rect that follows the mouse, and
- the values returned and put in the rect are way off screen. I used code
- from the book Macintosh Programming Primer volume 1. I'm at a loss why this
- isn't working. Here is the code fragment of what I'm doing. BTW, other
- events coming into this window work fine.
-
- BOOL MsgToMessage( WINDOW window, EventRecord *event )
- {
- short thePart, theMenu, theItem, lo, high;
- WindowPtr whichWindow;
- static LONG lasttick = 0, newtick;
- LONG menuChoice, windSize;
- Str255 accName;
- short accNumber, itemNumber;
- GrafPtr port;
- RECT sizeRect;
-
- Message.Class = 0;
-
- switch (event->what) {
- case mouseDown:
- thePart = FindWindow( event->where, &whichWindow );
- switch (thePart) {
- case inGrow:
- windSize = GrowWindow( whichWindow, event->where, &sizeRect );
- if ( windSize != 0 ) {
- GetPort( &port );
- SetPort( (GrafPtr)whichWindow );
- EraseRect( &whichWindow->portRect );
- lo = LoWord(windSize);
- high = HiWord(windSize);
- SizeWindow( whichWindow, lo, high, TRUE );
- InvalRect( &whichWindow->portRect );
- SetPort( port );
- }
- break;
- }
- break;
- }
- }
-
- I am #including all relevent function prototypes.
-
- Am I missing something obvious? Any helpful comments will be appreciated.
- -Ken Baer.
- baer@qiclab.scn.rain.com
- --
- // -Ken Baer. Programmer/Animator, Hash Enterprises
- \X/ Usenet: baer@qiclab.UUCP / Office: (206)573-9427
- "Hey, I think a glacier just passed us!" - Andy from Joyride
-