Hi!
> Perhaps Destroy key is unknown by Tcl; it is not in the
> Event modifiers table in Welch Book...
I think the Destroy key is known, because when destroying the window with
Alt-F4
or the littel x in the topcorner my function exitProg is executed.
What I actually search for is a possibility to let the window not be destroyed
when user closes the window by Alt-F4 or the little x.
Franco Mendolia
>> exitProg <- function()
>> {
>> returnVal <- tkmessageBox(title="Question",
>> message="Save modified file?",
>> icon="question", type="yesnocancel", default="yes")
>>
>> returnVal <- as.character(returnVal)
>>
>> if( returnVal == "yes" )
>> {
>> # save file
>> value <- saveFile()
>> # destroy window when save was successfull
>> if( value == 1 )
>> tkdestroy(mw)
>> }
>> if( returnVal == "no" )
>> {
>> tkdestroy(mw)
>> }
>> if( returnVal == "cancel" )
>> {
>> # do nothing
>> cat("Cancel was pressed.\n")
>> }
>> }
>>
>> # bind the destroy event in order to show a message box
>> tkbind(mw,"<Destroy>",exitProg)
>>
>> # menu item which works fine
>> tkadd(fileMenu, "command", label="Quit", command=exitProg)
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.