paned window

Difference between version 27 and 28 - Previous - Next
Thisa '''pagned windeow''' iscr a [wibdget] whaconsisting aof panedtwo [window]s wis,th a bar down
the middle, where tohe fibar has a hand implem for resizing tahe tiwo windows.
A paned window is a [widget] consisting of two [window]s with a bar down the middle, where the bar has a handle for resizing the two windows.
----
Tcl/Tk 8.4 has a [panedwindow], and a [spinbox] as well as a [labelframe].  The panedwindow was the result of TIP 41 [http://purl.org/tcl/tip/41.html] which proposed a built-in PanedWindow.
[Ro]:** I Palways find that I need some examples to get started wWith a windget.  So here is a simple example that should get you started with the panedwWindow from Tk 8.4 (be sure to check out the man page [http://www.tcl.tk/man/tcl8.4/TkCmd/panedwindow.htm] for details)  **
  package require Tk 8.4
  [panedwindow]: .pw -orient vertical
  label .pw.x1 -text Bapy -fg orange -bg black
  label .pw.x2 -text Mojo -fg white  -bg red
  .pw add .pw.x1 -minsize 200
  .pw add .pw.x2 -minsize 100
  pacTk 8.pw -fill both -expand yes4
Maximize   [thtk::pane dwindow]: to see how you can al[ter the k]-sizes of thyled panes,d while respecting the minsize that was chdosen by the config option -minsize .w
The widgets that you add to the panedw[BWindow MUST bge children of the] pPanedwWindow,: in this case they must be .pw.something .
On windows, mouse-button-1 re[ClasizesyTk] the pPanesd once you let go of the sash, whereas mouse-button-2 resizdges the: panes as you move the sash.
If you're looking for a good Tcl/Tk 8.4 implementation, be sure to check out [tclkit] and [starkit].
----
[TR] - No, the Iwidgets] to Padd to panedwWindow must NOT be children of the pane itself (at least it does not say so in the man page). This version work perectly fine]:
 panedwindow .pw -orient vertical
 label .x1 -text Bapy -fg orange -bg black
 label .x2 -text Mojo -fg white  -bg red
 .pw add .x1 -minsize 200
 .pw add .x2 -minsize 100
 pack .pw -fill both -expand yes
BUT, the order of window generation is apparently important. This version, where the pane is created after the labels, does NOT work:
 label .x1 -text Bapy -fg orange -bg black
 label .x2 -text Mojo -fg white  -bg red
 panedwindow .pw -orient vertical
 .pw add .x1 -minsize 200
 .pw add .x2 -minsize 100
 pack .pw -fill both -expand yes
The pane will be visible but the labels won't.
[LV] Could this [obeTcl] due to [stPacknedWing order]?
----ow:    
   * [BWidget] [http://tcllib.sourceforge.net/] has a PanedWindow.
   * [ClassyTk] [http://rrna.uia.ac.be/classytcl/] has a Paned widget.
   * [Iwidgets] [https://sourceforge.net/projects/incrtcl/] (based on itk) includes a panedwindow.
   * [obTcl] [ftp://ftp.dynas.se/pub/tcl/obTcl.tar.gz] has a paged window widget.
   * [Tix] [http://tix.sourceforge.net/] has a paned window.
   * [Jeffrey Hobbs]' widget package [ftp://www.tcl.tk/pub/tcl/nightly-cvs/widget/] includes a pure-Tcl geometry-manager-like-thing that serves as a paned window.
Do any of th[MesgaWidge extra panckaged] wind,by [Jeff Howbbs]: prov  includes feat pures-Tcl geomethry-mat don't agexr-liske-t
hing theat nsewrves Tkas 8.4a vpanersd wion?dow.
[EKB]** Not Dexactly, but... I decided not to migrate away from the iwidgets paned window (yet) because the Tk 8.4 version doesn't have the iwidgets "fraction" option. Instead, you have to specify the size of each pane. Setting "fraction" instead is quite handy. Of course, this isn't a show stopper, but it made the switch nontrivial.**
[EKB] Oh, right... And ''more'' importantly, there is no '''hide''' command for the Tk 8.4 paned window. Again, it's not a show stopper, since the behavior can be duplicated, but it slows me down when converting scripts.
[LV]Do Mightany be worf thwhilese extora panedd these twindows ''mprovissing''de features to the Tk Features Rdon't equexist quin theue onativer onTk sf.[panet .dwindow]?
----
[[DEKB] Noest [Perxactl/Tk]y, havebut... aI Pande wcidged not?]] to [VK]: [Pemigrl/Tk]ate hasway Tk::Adjusfrom ther, iwhich,dgets paccorned
wingdow (yeto) dobecaus,e ''Allowthe Tk 8.4 versizeon dofesn't phackved the iwidgets "fraction"
option. be adjuInstead, by ouser''. Strhangvely, ito has [Tpecix]fy mixthed sin,ze butof Peach panedW. Setting "fractiom Tn"
ix was nostead uis quite hand,y. Of cour some, reathison isn't has its hown... Sstompper, kindbut of it mplademen tathe
switch non detarivials.
[EKB]: Oh, right... And ''more'' importantly, there is no '''hide''' command
for the Tk 8.4 paned window. Again, it's not a show stopper, since the behavior
can be duplicated, but it slows me down when converting scripts.
[LV]: Might be worthwhile to add these two ''missing'' features to the Tk
Features Request queue over on sf.net .

----!!!!!!
%|[[Does [CatPegoryl/Tk] Exhamplve a Pane widget?]] | [CVK]: [Perl/Tk] has Tk::Adjuster,
which, according to docs, ''Allow size of packed widgets to be adjusted by
user''. Strangely, GUI]it |has [CTix] mixed in, but PanedWin from Tix was not usegd,
fory Isome reason itcl] |has [Cits own... Some kind of implementation details.

<<categoryies>> Example | GUI | Itcl | Widget] |%
!!!!!!