Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

tk_optionmenu(3tk) [debian man page]

tk_optionMenu(3tk)					       Tk Built-In Commands						tk_optionMenu(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
tk_optionMenu - Create an option menubutton and its menu SYNOPSIS
tk_optionMenu pathName varName value ?value value ...? _________________________________________________________________ DESCRIPTION
This procedure creates an option menubutton whose name is pathName, plus an associated menu. Together they allow the user to select one of the values given by the value arguments. The current value will be stored in the global variable whose name is given by varName 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 values and thereby select a new value. Once a new value is selected, it will be stored in the variable and appear in the option menubut- ton. The current value can also be changed by setting the variable. The return value from tk_optionMenu is the name of the menu associated with pathName, so that the caller can change its configuration options or manipulate it in other ways. EXAMPLE
tk_optionMenu .foo myVar Foo Bar Boo Spong Wibble pack .foo KEYWORDS
option menu Tk 4.0 tk_optionMenu(3tk)

Check Out this Related Man Page

tk_popup(3tk)						       Tk Built-In Commands						     tk_popup(3tk)

__________________________________________________________________________________________________________________________________________________

NAME
tk_popup - Post a popup menu SYNOPSIS
tk_popup menu x y ?entry? _________________________________________________________________ DESCRIPTION
This procedure posts a menu at a given position on the screen and configures Tk so that the menu and its cascaded children can be traversed with the mouse or the keyboard. Menu is the name of a menu widget and x and y are the root coordinates at which to display the menu. If entry is omitted or an empty string, the menu's upper left corner is positioned at the given point. Otherwise entry gives the index of an entry in menu and the menu will be positioned so that the entry is positioned over the given point. EXAMPLE
How to attach a simple popup menu to a widget. # Create a menu set m [menu .popupMenu] $m add command -label "Example 1" -command bell $m add command -label "Example 2" -command bell # Create something to attach it to pack [label .l -text "Click me!"] # Arrange for the menu to pop up when the label is clicked bind .l <1> {tk_popup .popupMenu %X %Y} SEE ALSO
bind(3tk), menu(3tk), tk_optionMenu(3tk) KEYWORDS
menu, popup Tk 4.0 tk_popup(3tk)
Man Page