Nope. You can bind other windows with <destroy> and a command, but the program will exit before it executes the command on the toplevel "." window.
What I do sometimes, is I set the WM_DELETE_COMMAND to do nothing, then I'll have an "Exit" button or menu choice that calls cleanup routines.
You must have been using an older version of BWidgets before. There is no longer a label option. I recommend creating your label and packing it before your combobox.
The options available for the ComboBox are listed here:
http://aspn.activestate.com/ASPN/docs/ActiveTcl/bwidget/ComboBox.html
I would recommend using either iwidgets or bwidgets for your combobox. These are supported by ActiveState and are simple to use. To return the value with a bwidget combobox, you would say:
.combobox getvalue
That returns an index. To get the text of that index:
set text [lindex [.combobox...
I'd use the window manager protocol command:
wm protocol . WM_DELETE_WINDOW <command>
Make sure that in command you call "exit." More information can be found here:
http://aspn.activestate.com/ASPN/docs/ActiveTcl/tcl/TkCmd/wm.htm#M28
Look into using the "open" command with command piplines. You can then use file event commands on the channel created and send that directly to stdout.
set chan [open | <command> <command args> r]
Bob's right, but this sounds like a perfect time to use an itcl class, especially if you have a number of variables to be set for each person. You'll find this to be a lot more scalable in the future as the definition of "person" changes.
I think there might be more wrong with your code. Are you creating this inside of a class?
I created the following program and it worked:
package require BWidget
pack [ButtonBox .test]
set bbox .test
$bbox add -text "HELLO WORLD" -highlightthickness 0 -takefocus 0 -relief link...
What packages are you loading? Only Bwidgets? I've found with programs that if a "puts" statement will prevent it from crashing, you most likely need to call "update" in your code. I would need to know more about your program and where it's crashing to help more.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.