Tk Source Code

View Ticket
Login
Ticket UUID: 2c3ed8aa2b0624e05d451b260871776371953abb
Title: windows: frame resizes to original size upon deletion of an interior widget
Type: Bug Version: 8.6.6
Submitter: bll Created on: 2016-12-28 18:07:11
Subsystem: 48. Geometry Management Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2016-12-28 18:07:11
Resolution: None Closed By: nobody
    Closed on:
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}