#Help w/SizeWindow!!!
15 messages in this thread
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
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;
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
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
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
Just add a space in front of every line, that keeps CIS from reformatting
everything.
[bonk] Thanks! 🙂
-Dave-
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
That's what I used. It took the command alright, but reformatted the post
anyway.
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
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
Mike,
Move that ReplyMsg() to after you gather the class info in my example.
-Dave
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.
Wha'd I do?!? I'll have to go back and check. It was late! 🙂
-Dave
Ooops. You got me. Thanks.
-Dave