Page 1 of 1
which message is sent upon a click into the closeBox?
Posted: Fri Jun 20, 2008 10:48 am
by rozek
Hello!
Sorry for bothering you, but I don't get further: which message is sent if one clicks into the CloseBox of a window's title bar?
I always thought, that would be a CloseStackRequest - but I can't see such if I observe the situation using the Message Watcher. Indeed, I can't see anything which would fit - just a bunch of mouse events, a suspendStack, and lots of cREVGeneral (as usual)
How can I trap a CloseStackRequest?
Thanks in advance for any help!
Posted: Fri Jun 20, 2008 11:14 am
by Mark
Hi Andreas,
Code: Select all
on closeStackRequest
beep
answer "Really?" with "Okay" or "Cancel"
if it is "Okay" then pass closeStackRequest
end closeStackRequest
Best,
Mark
Posted: Fri Jun 20, 2008 11:24 am
by rozek
Mark,
I already have this code in my stack script - but it never get's called (perhaps I should add, I'm working with Rev 2.9.0 under WinXP)
That's the reason why I had the idea of using the Message Watcher - et voila, the message never get's SENT! (unless the Message Watcher is buggy)
I'm somewhat lost now...
Posted: Fri Jun 20, 2008 12:00 pm
by rozek
Ok, I got it!
It's the IDE which causes the problem: the IDE's frontscript seems to catch the CloseStackRequest first. If the stack has been modified, it comes up with a dialog that let you save the stack - if you "Cancel", the message is not passed! Only if you "Save" (and, perhaps, if you "Don't save" as well) the message is passed.
This is probably a bug - I'll contact RR soon.
Posted: Fri Jun 20, 2008 11:26 pm
by Mark
Hi Andreas,
It is no bug. If you cancel the Save prompt, the stack won't close, thus your script can't run.
Best,
Mark
Posted: Sun Jun 22, 2008 7:38 am
by rozek
Dear Mark,
I would like to see the "Save dialog" opened by a "BackScript" rather than a "FrontScript" as the latter makes testing my stacks much more tedious - and their behaviour always depends on wether they run within an IDE or not.
Hmmm, how do people implementing IDE plug-ins solve that problem? If a plugin opens a window which is then to be closed or hidden without triggering that (in this case) annoying "Save dialog" - how is that achieved?
Should one write a "FrontScript" in front of the IDE "FrontScript"? Which then sends the "CloseStackRequest" directly to the affected stack? And a "BackScript" which opens the "SaveDialog" itself?