which message is sent upon a click into the closeBox?
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
which message is sent upon a click into the closeBox?
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!
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!
Kind regards,
Andreas Rozek
Andreas Rozek
Hi Andreas,
Best,
Mark
Code: Select all
on closeStackRequest
beep
answer "Really?" with "Okay" or "Cancel"
if it is "Okay" then pass closeStackRequest
end closeStackRequest
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
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...
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...
Kind regards,
Andreas Rozek
Andreas 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.
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.
Kind regards,
Andreas Rozek
Andreas Rozek
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
It is no bug. If you cancel the Save prompt, the stack won't close, thus your script can't run.
Best,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
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?
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?
Kind regards,
Andreas Rozek
Andreas Rozek