DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

VtOptionMenu(1vtcl)


VtOptionMenu -- create an OptionMenu widget, return widget name

Synopsis

VtOptionMenu widgetName [options]

Description

Creates an OptionMenu widget which is a menu system component that lets a user select one of several choices. OptionMenus are created like Pulldown menus. First the OptionMenu is created and then it is ``filled'' in with other widgets. (The Label class options are supported, so that the OptionMenus can be titled.) Returns the OptionMenu widget's name.

For example, to create an OptionMenu with the options dog, cat, and frog:

set menu [VtOptionMenu $form.menu -label "Pick one:"
set but1 [VtPushButton $menu.but1 -label dog]
set but2 [VtPushButton $menu.but2 -label cat]
set but3 [VtPushButton $menu.but3 -label frog]
Callbacks can be assigned to the individual widgets which make up the OptionMenu, or a callback can be assigned to the OptionMenu itself. If this is done, callbacks assigned to the OptionMenu children will be overridden and the OptionMenu callback will be called if any of the children are activated. The child which caused the callback to be called will be passed as callback data.

Options


-callback cmd (C)
Sets callback cmd as the routine to call when any of the options are activated (by <Space>, <Enter>, or a single mouse click). This callback overrides any activation callbacks assigned to children of the option menu

Additional callback keys:


selectedWidget
The name of the widget that activated this callback

value
The name of the widget that activated this callback

-selectedWidget widgetName ((SG)
Specifies the name of the widget that is selected in the option menu.

Return values

If VtOptionMenu fails, it returns one of the following error messages:

Standard errors
See ``Tcl widget creation errors'' in Developing Visual Tcl applications.

25 April 2004
© 2004 The SCO Group, Inc. All rights reserved.
UnixWare 7 Release 7.1.4 - 25 April 2004