This content has been marked as final. Show 6 replies
Thanks for the response. I already know commands to exit from the program.
What I'm looking for is how to trap when the user clicks on the close button of the title bar.
There's a Windows-only xtra called QuitMsg that will notify of a click
on the Close box.
You could also try fooling with the undocumented "on closeRequest"
handler and check for keys pressed when it fires to see if it's an
Alt+F4 or Esc key that's requesting the application to close.
Hi Mind's Eye
I am working on a full-screen program which I do not want the end user to be able to exit the application but I need the ability as the programmer to exit the application when necessary. I had some help from Mike Blaustein. To do this I placed an image (button) throughout the movie and made it transparent. I then used a script to tell the program to exit.
on mouseUp me
This works fine until you press the invisible button by mistake. To fix that, I added another part of script to allow the program to exit only when the invisible button is clicked ALONG WITH the shift key being pressed:
on MouseUp me
if the shiftDown then quit
If it's still possible that the user of your movie will hold Shift and click the button, try swapping out shift for another key or a combination of keys. HTH.
What I do is grab the screen when the projector is open, edite that graphic
and recreate the title bar in the movie. Then set the actual title bar off.
Then I can do whatever I want with the X box. One of the many advantages
beyond what you want to do is that you can add custom messages to the bar in
any format rather than just having the projector name there. For that
matter you could create a custom bar that doesn't look like the standard
"The Minds Eye" <email@example.com> wrote in message
>I want to trap the event when the user clicks the close box in the title
> a projector e.g:
> on closeWindow
> This works fine. However, I don't want the program bombing out when the
> accidentally presses the Esc. key.
> So I set the exit lock to true. But then the close button no longer works.
> Is there any way around this?
Thanks for your responses.
In most previous projects I've created my own titlebar. But in this one I particularly wanted to use the Windows interface titlebar but also want the exitLock on.
Sean's command "on closeRequest" was just the handler I was looking for.
It gets called when the user clicks on the close button and when the user presses escape. Perfect!