stk/Doc/Manual/option-menu.n

48 lines
1.5 KiB
Plaintext
Raw Normal View History

1996-09-27 06:29:02 -04:00
'\" Color=Green
'\"
'\" Copyright (c) 1990-1994 The Regents of the University of California.
'\" Copyright (c) 1994 Sun Microsystems, Inc.
'\"
'\" See the file "license.terms" for information on usage and redistribution
'\" of this file, and for a DISCLAIMER OF ALL WARRANTIES.
'\"
'\" @(#) optionMenu.n 1.3 95/06/07 21:15:45
'\"
.so STk-man.macros
.TH option-menu n 3.1 STk "Tk Built-In Commands"
.BS
'\" Note: do not modify the .SH NAME line immediately below!
.SH NAME
option-menu \- Create an option menubutton and its menu
.SH SYNOPSIS
(\fBTk:option-menu \fIw varname value \fR?\fIvalue value ...\fR?)
.BE
.SH DESCRIPTION
.PP
This procedure creates an option menubutton whose name is \fIw\fR,
plus an associated menu.
Together they allow the user to select one of the values
given by the \fIvalue\fR arguments.
The current value will be stored in the global variable whose
name is given by \fIvarname\fR and it will also be displayed as the label
in the option menubutton.
The user can click on the menubutton to display a menu containing
all of the \fIvalue\fRs and thereby select a new value.
Once a new value is selected, it will be stored in the variable
and appear in the option menubutton.
The current value can also be changed by setting the variable.
.PP
The return value from \fBTk:option-menu\fR is the menu
associated with \fIw\fR, so that the caller can change its configuration
options or manipulate it in other ways.
.SH EXAMPLE
.DS
(Tk:option-menu '.m 'foo "One" "Two" "Three")
(pack .m)
.DE
.SH SEE ALSO
menu, popup