irrational
unread,Apr 20, 2009, 3:28:01 AM4/20/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to starkit
I have an application that wants to do some cleaning-up and query user
about unsaved changes before quitting.
Here is a little test.tcl for doing this
--------------------------
# test.tcl
package require Tk
proc my_exit {} {
puts {Drive safely}
exit
}
button .q -text Quit -command my_exit
pack .q
bind . <Control-q> my_exit
bind . <Command-q> my_exit
--------------------------
You see my safe exit procedure should run on clicking the Quit button,
or typing Control-Q, or Command-Q.
On a Mac, running
wish test.tcl
all quit routes behave as intended. Using tclkits, the button and
Control-Q work as expected. However, running
tclkit-darwin-univ-aqua test.tcl
a Command-Q exits the tclkit without going through my_exit, and
running
tclkit-darwin-univ test.tcl
a Command-Q brings up a dialog as to whether I want to exit X11.
Why does this happen, and how do I get the behaviour I want?
(Actually I'd be happy with a "how" answer without the "why")
K