From a0d2862c1aa749c6c230ea1a17de725137cb775d Mon Sep 17 00:00:00 2001 From: dkf Date: Mon, 21 Jun 2004 14:48:04 +0000 Subject: Added example --- doc/optionMenu.n | 7 ++++++- doc/pack.n | 30 ++++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/doc/optionMenu.n b/doc/optionMenu.n index 17a2727..b6d3257 100644 --- a/doc/optionMenu.n +++ b/doc/optionMenu.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: optionMenu.n,v 1.2 1998/09/14 18:22:58 stanton Exp $ +'\" RCS: @(#) $Id: optionMenu.n,v 1.3 2004/06/21 14:48:04 dkf Exp $ '\" .so man.macros .TH tk_optionMenu n 4.0 Tk "Tk Built-In Commands" @@ -35,6 +35,11 @@ The current value can also be changed by setting the variable. The return value from \fBtk_optionMenu\fR is the name of the menu associated with \fIw\fR, so that the caller can change its configuration options or manipulate it in other ways. +.SH EXAMPLE +.CS +tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble +pack .foo +.CE .SH KEYWORDS option menu diff --git a/doc/pack.n b/doc/pack.n index ddda916..ad82adb 100644 --- a/doc/pack.n +++ b/doc/pack.n @@ -5,7 +5,7 @@ '\" See the file "license.terms" for information on usage and redistribution '\" of this file, and for a DISCLAIMER OF ALL WARRANTIES. '\" -'\" RCS: @(#) $Id: pack.n,v 1.3 2001/02/12 18:06:47 drh Exp $ +'\" RCS: @(#) $Id: pack.n,v 1.4 2004/06/21 14:56:28 dkf Exp $ '\" .so man.macros .TH pack n 4.0 Tk "Tk Built-In Commands" @@ -156,7 +156,6 @@ Returns a list of all of the slaves in the packing order for \fImaster\fR. The order of the slaves in the list is the same as their order in the packing order. If \fImaster\fR has no slaves then an empty string is returned. - .SH "THE PACKER ALGORITHM" .PP For each master the packer maintains an ordered list of slaves @@ -217,8 +216,7 @@ left in the cavity. If the cavity shrinks to zero size, then all remaining slaves on the packing list will be unmapped from the screen until the master window becomes large enough to hold them again. - -.SH "EXPANSION" +.SS "EXPANSION" .PP If a master window is so large that there will be extra space left over after all of its slaves have been packed, then the @@ -228,8 +226,7 @@ Extra horizontal space is distributed among the expandable slaves whose \fB\-side\fR is \fBleft\fR or \fBright\fR, and extra vertical space is distributed among the expandable slaves whose \fB\-side\fR is \fBtop\fR or \fBbottom\fR. - -.SH "GEOMETRY PROPAGATION" +.SS "GEOMETRY PROPAGATION" .PP The packer normally computes how large a master must be to just exactly meet the needs of its slaves, and it sets the @@ -243,7 +240,6 @@ If propagation is disabled then the packer will not set the requested width and height of the packer. This may be useful if, for example, you wish for a master window to have a fixed size that you specify. - .SH "RESTRICTIONS ON MASTER WINDOWS" .PP The master for each slave must either be the slave's parent @@ -251,7 +247,6 @@ The master for each slave must either be the slave's parent This restriction is necessary to guarantee that the slave can be placed over any part of its master that is visible without danger of the slave being clipped by its parent. - .SH "PACKING ORDER" .PP If the master for a slave is not its parent then you must make sure @@ -263,6 +258,25 @@ to create the master window first: the most recently created window will be highest in the stacking order. Or, you can use the \fBraise\fR and \fBlower\fR commands to change the stacking order of either the master or the slave. +.SH EXAMPLE +.CS +# Make the widgets +label .t \-text "This widget is at the top" \-bg red +label .b \-text "This widget is at the bottom" \-bg green +label .l \-text "Left\nHand\nSide" +label .r \-text "Right\nHand\nSide" +text .mid +\.mid insert end "This layout is like Java's BorderLayout" +# Lay them out +pack .t \-side top \-fill x +pack .b \-side bottom \-fill x +pack .l \-side left \-fill y +pack .r \-side right \-fill y +pack .mid \-expand 1 \-fill both +.CE + +.SH "SEE ALSO" +grid(n), place(n) .SH KEYWORDS geometry manager, location, packer, parcel, propagation, size -- cgit v0.12