If you click on the "Close" button of the window of a standalone, the program is stil residing in memory.
I have added an "Exit" button which does destroy the stack, but I was wondering if there is a way to code the "Close" or "X" button of the window?
Thanks in advance
Rob
Quitting a Standalone
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Quitting a Standalone
Rob Glassman
ArkStar
ArkStar
Re: Quitting a Standalone
Hi!
In the Dictionary, the message "closeStackRequest" appears to be sent when the Close button in the title bar is clicked. The dictionary entry says it is also sent when the File->Close menu item is selected, but there is a comment indicating that is not true.
Walt
In the Dictionary, the message "closeStackRequest" appears to be sent when the Close button in the title bar is clicked. The dictionary entry says it is also sent when the File->Close menu item is selected, but there is a comment indicating that is not true.
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor
Re: Quitting a Standalone
Thanks for your response,
I added this code to my card:
on closeStackRequest
answer "Are you sure?" with "No" or "Yes"
if it is "Yes" then
pass closeStackRequest
set the destroyStack of this stack to true
quit
end if
end closeStackRequest
I used the code I have in my "Exit" button, but while this closes the window with the dialog box, it still does not remove it from memory, BUT, it does remove it from memory when executed from the "Exit" button.
Any ideas?
Thanks again!
Rob
I added this code to my card:
on closeStackRequest
answer "Are you sure?" with "No" or "Yes"
if it is "Yes" then
pass closeStackRequest
set the destroyStack of this stack to true
quit
end if
end closeStackRequest
I used the code I have in my "Exit" button, but while this closes the window with the dialog box, it still does not remove it from memory, BUT, it does remove it from memory when executed from the "Exit" button.
Any ideas?
Thanks again!
Rob
Rob Glassman
ArkStar
ArkStar
Re: Quitting a Standalone
I would be careful where the "pass" is in the handler, see this from the Dictionary:
"Stops the current handler and passes the message to the next object in the message path."
It appears that "pass" should be the last statement, and the "quit" would be superfluous (but I haven't specificly tested this).
Walt
"Stops the current handler and passes the message to the next object in the message path."
It appears that "pass" should be the last statement, and the "quit" would be superfluous (but I haven't specificly tested this).
Walt
Walt Brown
Omnis traductor traditor
Omnis traductor traditor