Tk Source Code

View Ticket
Login
Ticket UUID: 219939
Title: Toplevels not resizing when widgets destroyed
Type: Bug Version: obsolete: 8.0.4
Submitter: welch Created on: 2000-10-31 18:54:00
Subsystem: 67. Unix Window Operations Assigned To: nobody
Priority: 1 Zero Severity:
Status: Closed Last Modified: 2001-04-25 06:16:16
Resolution: Duplicate Closed By: dgp
    Closed on: 2001-04-24 23:16:16
Description:
OriginalBugID: 1450 Bug
Version: 8.0.4
SubmitDate: '1999-03-04'
LastModified: '1999-08-07'
Severity: MED
Status: Closed
Submitter: pat
ChangedBy: hobbs
RelatedBugIDs: 2308
OS: AIX
OSVersion: 4.3
Machine: RS6000
ClosedDate: '1999-08-07'


Name:
Anthony Johnson
email:  [email protected]

ReproducibleScript:
toplevel .test
button .test.but1 -text "show button" -command "button .test.but2  -text {destroy me} -command {destroy .test.but2; pack .test.but2}"

-> Try pressing the "destroy" button after resizing the toplevel.
-> Try adding "wm resizable .test 0 0"

ObservedBehavior:
Catch-22: I want to destroy a widget from a toplevel window and have the toplevel shrink accordingly:
  - If the user changes the window size using the resize bars from the
    window manager, the toplevel will no longer shrink when widgets destroyed.
  - If I use "wm resizable .win 0 0" so the user can't resize the window, the
    toplevel will also not shrink when widgets destroyed.
Essencially, to have this function, I must allow the user to resize the window, but if they do so, the program no longer works as expected.

DesiredBehavior:
I need to EITHER:
  1. disable the resizing of the window by the user and still have the
     window adjust its size to fit new/destroyed widgets. OR
  2. allow the user to resize the window and STILL automatically re-adjust the
     window to fit new/destroyed widgets.