Menu

#1397 reqwidth and reqheight not reset

open
5
2003-02-02
2003-02-02
No

A frame's reqwidth and reqheight are not reset after
children/slaves are removed.

When a frame is created (with default -width 0 -height
0), the frame has a reqwidth and reqheight of 1 pixel.
When packing/griding a child label, for example, the
frame's reqwidth/height increases to accomodate its
child. After the child widget is
destroyed/unpacked/ungrided, I believe the frame's
reqwidth/height should return to 1 pixel, but it
remains the same.

set f [frame .f]
set l [label .f.l -text "Hello World"]

pack $f -e 1 -f both
puts "$f reqwidth='[winfo reqwidth $f]'
reqheight='[winfo reqheight $f]'"

pack $l
update
puts "$f reqwidth='[winfo reqwidth $f]'
reqheight='[winfo reqheight $f]'"

destroy $l
update
puts "$f reqwidth='[winfo reqwidth $f]'
reqheight='[winfo reqheight $f]'"

returns:

.f reqwidth='1' reqheight='1'
.f reqwidth='71' reqheight='20'
.f reqwidth='71' reqheight='20'

This happens on Linux, tcl_patchLevel 8.3.4 / 8.4.0 / 8.4.1

Discussion

  • Jeffrey Hobbs

    Jeffrey Hobbs - 2003-07-17

    Logged In: YES
    user_id=72656

    did you try the geom reset'ing command 'wm geom . {}' ?

     
  • Mark G. Saye

    Mark G. Saye - 2003-09-04

    Logged In: YES
    user_id=264793

    wm geometry . {} doesn't affect the requested size of a
    frame widget.

    A workaround is to set the width/height of the parent to 1
    and back to 0 i.e.:

    destroy $l
    $f configure -width 1 -height 1
    $f configure -width 0 -height 0

     
MongoDB Logo MongoDB