Manual Pages for UNIX Darwin command on man iwidgets_optionmenu
MyWebUniversity

Manual Pages for UNIX Darwin command on man iwidgets_optionmenu

iwidgets::optionmenu(1) [incr Widgets] iwidgets::optionmenu(1)

NAME

iwidgets::optionmenu - Create and manipulate a option menu widget

SYNOPSIS

iiwwiiddggeettss::::ooppttiioonnmmeennuu pathName ?options? IINNHHEERRIITTAANNCCEE

itk::Widget <- iwidgets::Labeledwidget <- iwidgets::Optionmenu

SSTTAANNDDAARRDD OOPPTTIIOONNSS aaccttiivveeBBaacckkggrroouunndd aaccttiivveeBBoorrddeerrWWiiddtthh aaccttiivveeFFoorreeggrroouunndd bbaacckkggrroouunndd bboorrddeerrWWiiddtthh ccuurrssoorr ddiissaabblleeddFFoorreeggrroouunndd ffoonntt ffoorreeggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss rreelliieeff See the "options" manual entry for details on the standard options. IINNHHEERRIITTEEDD OOPPTTIIOONNSS ddiissaabblleeddFFoorreeggrroouunndd llaabbeellBBiittmmaapp llaabbeellFFoonnttllaabbeellIImmaaggee llaabbeellMMaarrggiinn llaabbeellPPooss llaabbeellTTeexxtt llaabbeellVVaarriiaabbllee ssttaattee ssttiicckkyy See the "LabeledWidget" manual entry for details on the inherited options.

WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS

Name: cclliicckkTTiimmee Class: CClliicckkTTiimmee

Command-Line Switch: -cclliicckkttiimmee

Interval time, in msec, used to determine that a single mouse click has occurred. Used to post menu on a "quick" mouse click.

NNoottee: changing this value may cause the sigle-click functional-

ity to not work properly. The default is 150 msec. Name: ccoommmmaanndd Class: CCoommmmaanndd

Command-Line Switch: -ccoommmmaanndd

Specifies a Tcl command procedure to be evaluated following a change in the current option menu selection. Name: ccyycclliiccOOnn Class: CCyycclliiccOOnn

Command-Line Switch: -ccyycclliiccoonn

Turns on/off the 3rd mouse button capability. The value may be specified in any of the forms acceptable to TTccllGGeettBBoooolleeaann. 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. Name: ppooppuuppCCuurrssoorr Class: CCuurrssoorr

Command-Line Switch: -ppooppuuppccuurrssoorr

Specifies the mouse cursor to be used for the popup menu. The value may have any of the forms acceptable to TTkkGGeettCCuurrssoorr. Name: ssttaattee Class: SSttaattee

Command-Line Switch: -ssttaattee

Specified one of two states for the optionmenu: nnoorrmmaall, or ddiiss-

aabblleedd. If the optionmenu is disabled, then option menu selec-

tion is ignored. Name: wwiiddtthh Class: WWiiddtthh

Command-Line Switch: -wwiiddtthh

Specifies a fixed size for the menu button label in any of the forms acceptable to TkGetPixels. 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.

DESCRIPTION

The iiwwiiddggeettss::::ooppttiioonnmmeennuu command creates an option menu widget with options to manage it. An option menu displays a frame containing a

label and a button. A pop-up menu will allow for the value of the but-

ton to change. MMEETTHHOODDSS The iiwwiiddggeettss::::ooppttiioonnmmeennuu command creates a new Tcl command whose 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 ...? Option and the args determine the exact behavior of the command. Many of the widget commands for an optionmenu take as one argument an

indicator of which entry of the option menu to operate on. These indi-

cators are called indexes and may be specified in any of the following forms: number Specifies the entry numerically, where 0 corresponds to the

top-most entry of the option menu, 1 to the entry below it,

and so on. eenndd Indicates the bottommost entry in the menu. If there are

no entries in the menu then -1 is returned.

sseelleecctt Returns the numerical index of the currently selected option menu entry. If no entries exist in the menu, then

-1 is returned.

pattern If the index doesn't satisfy one of the above forms then

this form is used. Pattern is pattern-matched against the

label of each entry in the option menu, in order from the top down, until a matching entry is found. The rules of TTccllSSttrriinnggMMaattcchh are used. The following widget commands are possible for optionmenu widgets:

WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS

pathName ccggeett option Returns the current value of the configuration option given by

option. Option may have any of the values accepted by the iiwwiidd-

ggeettss::::ooppttiioonnmmeennuu command. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If no

option is specified, returns a list describing all of the avail-

able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo 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 iiwwiiddggeettss::::ooppttiioonnmmeennuu command. pathName ddeelleettee first ?last? Delete all of the option menu entries between first and last inclusive. If last is omitted then it defaults to first. pathName ddiissaabbllee index Disable the option menu entry specified by index. Disabling a 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 eennaabbllee index Enable the option menu entry specified by index. Enabling a menu item allows the user to select this item from the menu. pathName ggeett ?first? ?last?

If no arguments are specified, this operation returns the cur-

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 iinnddeexx index Returns the numerical index corresponding to index. pathName iinnsseerrtt index string ?string? Insert an item, or list of items, into the menu at location index. pathName sseelleecctt index

Select an item from the option menu to be displayed as the cur-

rently selected item. pathName ssoorrtt mode Sort the current menu in either aasscceennddiinngg, or ddeesscceennddiinngg order. The values iinnccrreeaassiinngg, or ddeeccrreeaassiinngg are also accepted. CCOOMMPPOONNEENNTTSS Name: mmeennuuBBttnn Class: MMeennuubbuuttttoonn The menuBtn component is the option menu button which displays the current choice from the popup menu. See the "menubutton" widget manual entry for details on the menuBtn component item. Name: ppooppuuppMMeennuu Class: MMeennuu The popupMenu component is menu displayed upon selection of the menu button. The menu contains the choices for the option menu. See the "menu" widget manual entry for details on the popupMenu component item. EEXXAAMMPPLLEE 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

AACCKKNNOOWWLLEEDDGGEEMMEENNTTSS:: Michael J. McLennan Borrowed some ideas (next & previous) from OptionButton class. Steven B. Jaggers Provided an initial prototype in [incr Tcl]. Bret Schuhmacher Helped with popup menu functionality. AUTHOR Alfredo Jahn KKEEYYWWOORRDDSS optionmenu, widget Tk iwidgets::optionmenu(1)




Contact us      |      About us      |      Term of use      |       Copyright © 2000-2019 MyWebUniversity.com ™