Assuming that the second window is created via a proc
should I use the "withdraw" function of the main menu? Should the sequence
be:
proc foo
{wm withdraw .w
(draw subordinate window)
wm deiconify .w
}
??
..or do I need to reactivate the first window as part of the exit routine of
the second window?
--
John Culleton
> {wm withdraw .w
> (draw subordinate window)
> wm deiconify .w
No.
> ..or do I need to reactivate the first window as part of the exit routine of
> the second window?
Yes.
I like to pick some inocuous label in the "second window"
and bind the action to destruction of that widget.
bind .w2.labxxx <Destroy> { wm deiconify .w }
Instead of just [deiconify], you probably should do:
if { [winfo exists .w] } {
wm deiconify .w
raise .w
}
If you bind to .w2 directly, the event fires when any and every
widget within .w2 is destroyed (see bindtags). But if you feel
is is morally superior to sample the destruction of .w2 itself,
then you should test:
if { [winfo toplevel %W] eq %W } { ...
--
Donald Arseneau as...@triumf.ca