| Description: |
Windows only. Windows 7 (et.al.), tcl/tk 8.6.6
In the following program, when the window is resized to a smaller size
and the destroy of the button activates, the window size gets
reconfigured back to its original size.
Reference:
https://groups.google.com/d/msg/comp.lang.tcl/IoS8S3jlu6w/-RVXxkyFDwAJ
package require Tk
wm geometry . 200x300
proc configFrame {f} {
# get frame height
set fH [winfo height $f]
if {$fH < 250 } {
destroy .b
}
}
button .b -text "button"
#place .b -x 10 -y 40
grid .b -in . -padx 10 -pady 10
update
bind . <Configure> {configFrame %W}
|