beetlebug▾
/

pack propagate

Gives or sets whether a container gets the size that its list needs.

pack propagate CONTAINER ?BOOLEAN?

Description

With BOOLEAN 1, the default, the container sets its requested size to the size that its packed widgets need. With 0, the container keeps the requested size of its own options, such as -width and -height of a frame. With no BOOLEAN, gives the current value.

Returns

The current value, 0 or 1, or an empty string when BOOLEAN is given.

Examples

% frame .pr
> pack propagate .pr
1

% frame .pr2 -width 50 -height 30
> pack propagate .pr2 0
> frame .pr2.big -width 80 -height 80
> pack .pr2.big
> update
> list [winfo reqwidth .pr2] [winfo reqheight .pr2]
50 30

Errors

% pack propagate . x
expected boolean value but got "x"
-errorcode NONE

% pack propagate . 0 1
wrong # args: should be "pack propagate window ?boolean?"
-errorcode TCL WRONGARGS

Facts

Capability
None.
Tcl release
Tcl 9.1 and 8.6.
Since
ztk 1.0.0-beta.1

See also