optionMenu
Author: Peter G. Baum (peter@dr-baum.net)
Keywords: gnocl, Tcl, gtk, gnome

## NAME

optionMenu - Create and manipulate a optionMenu widget

## SYNOPSIS

optionMenu ?-option optionVal ...?

## OPTIONS

-command
  Tcl command which is executed if the selected item changes. That means that it is also executed if the widget changes because of a change of a via the -variable option associated variable.
  Before evaluating every percent (%) and its following character is substituted in command:

  %% | by %,
  %v | by value of the selected option
  %w | by the widget-ID

  type: string
  default: ""

-variable
  Name of a (global) variable which is changed if the state of the item changes. If the variable does not exist, it is created and, if options are added via the add command, set to the value of the first option. It the variable does exist, the option with the same value as the variable is selected. If the variable is set externaly (e.g. via the set command), the state of the item is changed and command called, if it exists.
  type: string
  default: ""

-menu
  Widget Id of a menu widget
  type: widget-id
  default: ""

-tooltip
  Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.
  type: string
  default: ""

-sensitive
  Wheather or not the item is sensitve to user input.
  type: boolean
  default: 1

## DESCRIPTION

An optionMenu is used to select an option among different alternatives similar to radioButtons. The different alternatives are presented via a menu widget. This can either be constructed and added via the -menu option, or (prefered method) added via the add command.

## WIDGET COMMANDS

The optionMenu command creates a new Tcl command whose name is an ID returned on widget creation. This command may be used to invoke various operations on the widget. It has the following general form:
ID option ?arg arg ...?
option and arg determine the exact behavior of the command. The following commands are possible for optionMenu widgets:

ID add txt ?-value val?
  Add an option with text txt. If option -value is given, the status of variable is changed.

ID getValue
  Get value of selected item.

ID setValue val
  Sets the option with the value val, changes variable and executes command.

## KEYWORDS

Copyright © 2001 - 2002 P. G. Baum