Charles.Forsyth20060303-partialeea662d19 years agoHistory
148 lines · 4.7 KB · Text
RawDownload
.TH CHOICEBUTTON 9.SH NAMEchoicebutton \- create and manipulate choicebutton widgets.SH SYNOPSIS\f5choicebutton\fI \fIpathName \fR?\fIoptions\fR?.SH STANDARD OPTIONS.EX-activebackground -borderwidth      -relief-activeforeground -font             -text-anchor           -foreground-background       -image-bitmap           -justify.EE.SH "WIDGET-SPECIFIC OPTIONS".TP.B -command \fIcommand\fPSpecifies a Tk command to associate with the button.  This commandis typically invoked when mouse button 1 is released over the buttonwindow.  The button's global variable (\f5-variable\fR option) willbe updated before the command is invoked..TP.B -height \fIdist\fPSpecifies a desired height for the button.If this option isn't specified, the button's desired height is computedfrom the size of the highest item in the.B -valueslist..TP.B -selectcolor \fIcolour\fPSpecifies a background colour to use when the button is selected.If specified as an empty string, no special colour is used fordisplaying when the widget is selected..TP.B -values \fIlist\fPSpecifies a list of all the values the choicebutton can choose from..TP.B -variable \fIstring\fPSpecifies name of global variable to set whenever this button isselected. The variable will be set to the index of the currentlyselected item. Changes in this variable also cause the button tochoose the appropriate item (provided it is an integer and withinrange)..TP.B -width \fIdist\fPSpecifies a desired width for the button.If this option isn't specified, the button's desired width is computedfrom the size of the widest item in the.B -valueslist..SH DESCRIPTIONThe \f5choicebutton\fR command creates a new window (given by the\fIpathName\fR argument) and makes it into a choicebutton widget.Additionaloptions, described above, may be specified on the command lineto configure aspects of the choicebutton such as its colours, font,text, and initial relief.  The \f5choicebutton\fR command returns its\fIpathName\fR argument.  At the time this command is invoked,there must not exist a window named \fIpathName\fR..PPA choicebutton is a widget that displays a textual string,one of the items given in the.I listargument to the.B -valuesoption.When clicked on, the choicebutton displays a menu showingall the available choices, allowing the user to changethe choice by selecting an item.In the description below, an.I indexis a zero-based index into the set of values specified withthe.B -valuesoption..SH "WIDGET COMMAND"The \f5choicebutton\fR command creates a new Tk command whosename is \fIpathName\fR.  Thiscommand may be used to invoke variousoperations on the widget.  It has the following general form:.RS.EX\fIpathName option \fR?\fIarg arg ...\fR?.EE.RE\fIOption\fR and the \fIarg\fRsdetermine the exact behaviour of the command.  The followingcommands are possible for choicebutton widgets:.TP\fIpathName \f5cget\fR \fIoption\fRReturns the current value of the configuration option givenby \fIoption\fR.\fIOption\fR may have any of the values accepted by the \f5choicebutton\fRcommand..TP\fIpathName \f5configure\fR ?\fIoption\fR? ?\fIvalue option value ...\fR?Query or modify the configuration options of the widget.If no \fIoption\fR is specified, returns a list of all ofthe available options for \fIpathName\fR.  Ifone or more \fIoption-value\fR pairs are specified, the commandmodifies the given widget option(s) to have the given value(s);  inthis case the command returns an empty string.\fIOption\fR may have any of the values accepted by the \f5choicebutton\fRcommand..TP\fIpathName \f5get\fR ?\fIvalue\fR?Get the index of the first item with.IR value .If.I valueis not given, get the index of the currently selected item..TP\fIpathName \f5set\fR \fIindex\fRSets the current item to the.IR index thvalue..TP\fIpathName \f5getvalue\fR ?\fIindex\fR?Get the value of the.IR index thitem. If.I indexis not given, get the value of the currently selected item..TP\fIpathName \f5setvalue\fR \fIvalue\fRSet the current item to the first item having.IR value .If no item has that value, no change is made,and an error is returned..TP\fIpathName \f5invoke\fR \fIindex\fRDoes just what would have happened if the user invoked the choicebuttonwith the mouse and selected the item at.IR index :sets the current item to.I indexand runsits associated Tk command, if there is one.The return value is that from invoking the Tk command, or anempty string if there is no associated command..TP\fIpathName \f5valuecount\fRReturns the number of values configured in the choicebutton..SH SEE ALSO.IR button (9),.IR checkbutton (9),.IR options (9),.IR radiobutton (9),.IR types (9)