-command command Specifies a Tk command to associate with the button. This command is typically invoked when mouse button 1 is released over the button window. The button's global variable (\f5-variable option) will be updated before the command is invoked.
-height dist Specifies a desired height for the button. If this option isn't specified, the button's desired height is computed from the size of the highest item in the -values list.
-selectcolor colour Specifies a background colour to use when the button is selected. If specified as an empty string, no special colour is used for displaying when the widget is selected.
-values list Specifies a list of all the values the choicebutton can choose from.
-variable string Specifies name of global variable to set whenever this button is selected. The variable will be set to the index of the currently selected item. Changes in this variable also cause the button to choose the appropriate item (provided it is an integer and within range).
-width dist Specifies a desired width for the button. If this option isn't specified, the button's desired width is computed from the size of the widest item in the -values list.
A choicebutton is a widget that displays a textual string, one of the items given in the list argument to the -values option. When clicked on, the choicebutton displays a menu showing all the available choices, allowing the user to change the choice by selecting an item. In the description below, an index is a zero-based index into the set of values specified with the -values option.
.EX pathName option ?arg arg ...?
pathName \f5cget option Returns the current value of the configuration option given by option. Option may have any of the values accepted by the \f5choicebutton command.
pathName \f5configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list of all of the available options for pathName. If one or more option-value pairs are specified, 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 \f5choicebutton command.
pathName \f5get ?value? Get the index of the first item with value . If value is not given, get the index of the currently selected item.
pathName \f5set index Sets the current item to the index th value.
pathName \f5getvalue ?index? Get the value of the index th item. If index is not given, get the value of the currently selected item.
pathName \f5setvalue value Set the current item to the first item having value . If no item has that value, no change is made, and an error is returned.
pathName \f5invoke index Does just what would have happened if the user invoked the choicebutton with the mouse and selected the item at index : sets the current item to index and runs its associated Tk command, if there is one. The return value is that from invoking the Tk command, or an empty string if there is no associated command.
pathName \f5valuecount Returns the number of values configured in the choicebutton.