summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authordonal.k.fellows@manchester.ac.uk <dkf>2006-11-16 11:22:31 (GMT)
committerdonal.k.fellows@manchester.ac.uk <dkf>2006-11-16 11:22:31 (GMT)
commit6fecc1ff621c3412e9ccd290d3c6b781b4a771af (patch)
treef7720f98d3f828b9f72f3c7fe2363dd48c1cba15 /doc
parenta98146f7094cd61044ab4b818e5adf4c32d702e8 (diff)
downloadtk-6fecc1ff621c3412e9ccd290d3c6b781b4a771af.zip
tk-6fecc1ff621c3412e9ccd290d3c6b781b4a771af.tar.gz
tk-6fecc1ff621c3412e9ccd290d3c6b781b4a771af.tar.bz2
Added example
Diffstat (limited to 'doc')
-rw-r--r--doc/labelframe.n43
1 files changed, 40 insertions, 3 deletions
diff --git a/doc/labelframe.n b/doc/labelframe.n
index 7a5c6ec..fb3ea2f 100644
--- a/doc/labelframe.n
+++ b/doc/labelframe.n
@@ -6,7 +6,7 @@
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\"
-'\" RCS: @(#) $Id: labelframe.n,v 1.1 2001/09/26 21:36:19 pspjuth Exp $
+'\" RCS: @(#) $Id: labelframe.n,v 1.2 2006/11/16 11:22:32 dkf Exp $
'\"
.so man.macros
.TH labelframe n 8.4 Tk "Tk Built-In Commands"
@@ -134,14 +134,51 @@ modifies the given widget option(s) to have the given value(s); in
this case the command returns an empty string.
\fIOption\fR may have any of the values accepted by the \fBlabelframe\fR
command.
-
.SH BINDINGS
.PP
When a new labelframe is created, it has no default event bindings:
labelframes are not intended to be interactive.
+.SH EXAMPLE
+This shows how to build part of a GUI for a hamburger vendor. The
+\fBlabelframe\fR widgets are used to organize the available choices by
+the kinds of things that the choices are being made over.
+.PP
+.CS
+grid [\fBlabelframe\fR .burger -text "Burger"] \\
+ [\fBlabelframe\fR .bun -text "Bun"] -sticky news
+grid [\fBlabelframe\fR .cheese -text "Cheese Option"] \\
+ [\fBlabelframe\fR .pickle -text "Pickle Option"] -sticky news
+foreach {type name val} {
+ burger Beef beef
+ burger Lamb lamb
+ burger Vegetarian beans
+
+ bun Plain white
+ bun Sesame seeds
+ bun Wholemeal brown
+ cheese None none
+ cheese Cheddar cheddar
+ cheese Edam edam
+ cheese Brie brie
+ cheese Gruy\\u00e8re gruyere
+ cheese "Monterey Jack" jack
+
+ pickle None none
+ pickle Gherkins gherkins
+ pickle Onions onion
+ pickle Chili chili
+} {
+ set w [radiobutton .$type.$val -text $name -anchor w \\
+ -variable $type -value $val]
+ pack $w -side top -fill x
+}
+set burger beef
+set bun white
+set cheese none
+set pickle none
+.CE
.SH "SEE ALSO"
frame(n), label(n)
-
.SH KEYWORDS
labelframe, widget