CompuServe Thread

#Help w/SizeWindow!!!

15 messages in this thread
#56112From: Mike WeiblenJul 7, 1989 7:45 AM
Hi! I'm having a bit of trouble with the Intuition SizeWindow() function. In the Intuition manual, it says that SizeWindow() will send your program a SIZEWINDOW IDCMP message when it is done resizing your window. Well…. I never see a SIZEWINDOW after calling SizeWindow()! Sure, my IDCMP flag is set & I *DO* get SIZEWINDOW messages when I yank on the window resizing gadget! This all results in my program resizing the window, but never knowing when the resize is finished to redraw the graphics. Am I doing something dumb or is there a bug in SizeWindow(). Thanks for any tips…. Mike Weiblen
#56147From: David CzayaJul 7, 1989 1:39 PM
You have to do a Wait() for the message to know when SizeWindow() is done. If you can make out Modula-2 code, here's a procedure you could call to check that your window sizing task is completed PROCEDURE CheckSize(win: WindowPtr); VAR sig : SignalSet; msg : IntuiMessagePtr; class : IDCMPFlagSet; BEGIN LOOP sig := Wait(SignalSet{CARDINAL(win^.UserPort^.mpSigBit)}); msg := GetMsg(win^.UserPort); WHILE msg # NIL DO ReplyMsg(msg); class := msg^.Class; IF class = IDCMPFlagSet{NewSize} THEN RETURN; END; msg := GetMsg(win^.UserPort); END; END; END CheckSize;
#56244From: Mike WeiblenJul 8, 1989 9:24 AM
Hi Dave! Yup, M2 is my language of choice. Ok, I understand what you're getting at, but I think my code would have worked. As far as I can tell, I'm not getting the SIZEWINDOW message at all. I do fall back into a Wait/GetMsg routine after the SizeWindow() call, but I never see a message. What I'm doing is installing a ARexx port in Zippy; one of the commands allows you to resize by ARexx in addition to the size gadget. After the ARexx command, I go back to the message routine. I'll have a look at your code example. If I still have trouble, I'll try to whip up an example module myself. Thanks VERY much! I've have some trouble finding anyone to even respond to some of my programming questions. Cheers…. Mike Weiblen exit
#56283From: David CzayaJul 8, 1989 1:33 PM
Mike, Glad to help. I have used the CheckSize() function in a couple of projects already and it works well. One project in particular can resize a window depending on several conditions and if I just say: IF condition THEN SizeWindow(win,params); CheckSize(win); END; The window will get sized, go to the CheckSize() function and wait around until the sizing is done. When it returns, I am assured that the sizing is complete. Works fine. Good luck. -Dave
#56284From: David CzayaJul 8, 1989 1:37 PM
Sorry about all the bad formatting in these messages. I can't figure out how to do a "Save UnFormatted" command on this network. Looks good until I save it. 🙂 -Dave
#56293From: M2S/Phil CampJul 8, 1989 1:59 PM
Just add a space in front of every line, that keeps CIS from reformatting everything.
#56341From: David CzayaJul 8, 1989 11:14 PM
[bonk] Thanks! 🙂 -Dave-
#56305From: Kevin DarlingJul 8, 1989 4:26 PM
Dave, you used to be able to do a Save Unformatted by using the "su" instead of just "s" command. I think it still works. ? kev
#56342From: David CzayaJul 8, 1989 11:15 PM
That's what I used. It took the command alright, but reformatted the post anyway.
#56300From: Bill HawesJul 8, 1989 2:44 PM
Mike, Keep in ming that SIZEWINDOW is an asynchronous call; after the function returns, the window has not been sized yet. Intuition simply creates an internal event to resize the window at some point in the future, and this can sometime create problems with the timing of Size/Move window calls. Bill
#56532From: Mike WeiblenJul 9, 1989 11:33 PM
Hi Bill! Yup, at this point I am *quite* familiar with SizeWindow()s async nature. My problem is/was that I was never seeing the message the manual says I should get when Intuition is done resizing. Dave has given me a routine to try (which I haven't had time for yet), though I thought my solution would have worked. I'll bang on it some more… BTW, thanks VERY much for ARexx1.10 & the speed with which you sent the update! A very nice product. Thanks for the help… Mike
#56615From: David CzayaJul 10, 1989 6:44 PM
Mike, Move that ReplyMsg() to after you gather the class info in my example. -Dave
#56457From: Vic WagnerJul 9, 1989 6:32 PM
Sheesh, David, you just committed the MORTAL SIN of real time programming. You are referencing a region of memory AFTER you have returned control of it to the system. I'm referring to you're use of msg AFTER the ReplyMsg(msg) You MUST retrieve the information from the msg record BEFORE replying to it.
#56545From: David CzayaJul 10, 1989 12:20 AM
Wha'd I do?!? I'll have to go back and check. It was late! 🙂 -Dave
#56546From: David CzayaJul 10, 1989 12:21 AM
Ooops. You got me. Thanks. -Dave