![]() |
ActiveTcl User Guide
|
![]() |
iwidgets::optionmenu - Create and manipulate a option menu widget
iwidgets::optionmenu pathName ?options?
itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Optionmenu
activeBackground activeBorderWidth activeForeground background borderWidth cursor disabledForeground font
options.
options.
click has occurred. Used to post menu on a «quick» mouse click.
to not work properly. The default is 150 msec.
change in the current option menu selection.
specified in any of the forms acceptable to Tcl_GetBoolean. This feature allows the right mouse button to cycle through the popup menu list without poping it up. The right mouse button cycles through the menu in reverse order. The default is true.
value may have any of the forms acceptable to Tk_GetCursor.
abled. If the optionmenu is disabled, then option menu
selection is ignored.
forms acceptable to Tk_GetPixels. If the text is too small to
fit in the label, the text is clipped. Note: Normally, when a new
list is created, or new items are added to an existing list, the
menu button label is resized automatically. Setting this option
overrides that functionality.
_________________________________________________________________
with options to manage it. An option menu displays a frame con- taining a label and a button. A pop-up menu will allow for the value of the button to change.
name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:
pathName option ?arg arg ...?
ment an indicator of which entry of the option menu to operate
on. These indicators are called indexes and may be specified
in any of the following forms:
gets:
pathName cget option
option. Option may have any of the values accepted
by the iwid- gets::optionmenu command.
pathName configure ?option? ?value
option value ...?
option is specified, returns a list describing all of the
avail- able options for pathName (see
Tk_ConfigureInfo for information on the format of this
list). If option is specified with no value, then the
command returns a list describing the one named option (this list
will be identical to the corresponding sublist of the value
returned if no option is specified). If one or more
option-value pairs are specified, then the command modifies
the given widget option(s) to have the given value(s); in this case
the command returns an empty string. Option may have any of
the values accepted by the iwidgets::optionmenu command.
pathName delete first ?last?
inclusive. If last is omitted then it defaults to
first. pathName disable index
menu item will prevent the user from being able to select this
item from the menu. This only effects the state of the item in the
menu, in other words, should the item be the currently selected
item, the programmer is responsible for determining this condition
and taking appropriate action.
pathName enable index
item allows the user to select this item from the menu.
pathName get ?first? ?last?
rently selected option menu item. Otherwise, it returns the name of the option at index first, or a range of options between first and last.
pathName index index
pathName insert index string
?string?
index.
pathName select index
rently selected item.
pathName sort mode
the current choice from the popup menu. See the «menubutton" widget manual entry for details on the menuBtn component item.
menu button. The menu contains the choices for the option menu.
component item.
package require Iwidgets 4.0
iwidgets::optionmenu .om -labelmargin 5 \
-labelon true -labelpos w -labeltext «Operating System
:"
.om insert end Unix VMS Linux OS/2 {Windows NT} DOS .om sort
ascending
.om select Linux
pack .om -padx 10 -pady 10
optionmenu, widget