Updated 2007-03-09 11:37:00 by jdc

Manual page:

From Tk 8.4 on, Tk has its own panedwindow.

Examples on use of BWidget::PanedWindow:
 package require BWidget

 # Create PanedWindow with 3 horizontal panes
 set pwh [PanedWindow .pwh -side top]
 pack $pwh -fill both -expand true

 set fh1 [$pwh add]
 set fh2 [$pwh add]
 set fh3 [$pwh add]

 # In second pane, add 2 horizontal panes
 set pwv [PanedWindow $fh2.pwv -side left]
 pack $pwv -fill both -expand true

 set fv1 [$pwv add]
 set fv2 [$pwv add]

 # Make large enough to be able to resize the panes
 wm geometry . 500x500

Jos Decoster The following examples show the difference between extra and available values for the -weights option. You can compare this option with the -stretch option of the Tk 8.5 panedwindow widget.
 package require BWidget

 wm geometry . 500x500+200+200

 set f1 [frame .f1]
 set f2 [frame .f2]
 pack .f1 .f2 -fill both -expand true

 # Create 3 panes where only extra space is divided among the different panes
 # relative to their weight.
 set pwh1 [PanedWindow $f1.pwh -side top -weights extra]
 pack $pwh1 -fill both -expand true
 set fh1_1 [$pwh1 add -weight 2]
 pack [text $fh1_1.txt] -fill both -expand true
 set fh1_2 [$pwh1 add -weight 2]
 pack [text $fh1_2.txt] -fill both -expand true
 set fh1_3 [$pwh1 add -weight 1]
 pack [text $fh1_3.txt] -fill both -expand true

 # Create 3 panes where all space is divided among the different panes
 # relative to their weight.
 set pwh2 [PanedWindow $f2.pwh -side top -weights available]
 pack $pwh2 -fill both -expand true
 set fh2_1 [$pwh2 add -weight 2]
 pack [text $fh2_1.txt] -fill both -expand true
 set fh2_2 [$pwh2 add -weight 2]
 pack [text $fh2_2.txt] -fill both -expand true
 set fh2_3 [$pwh2 add -weight 1]
 pack [text $fh2_3.txt] -fill both -expand true

Category Widget of the BWidget extension