Charles.Forsyth20060303-partialeea662d19 years agoHistory
192 lines · 7.8 KB · Text
RawDownload
.TH RADIOBUTTON 9.SH NAMEradiobutton \- Create and manipulate radiobutton widgets.SH SYNOPSIS\f5radiobutton\fI \fIpathName \fR?\fIoptions\fR?.SH STANDARD OPTIONS.EX-activebackground -disabledcolor      -justify-activeforeground -font               -relief-anchor           -foreground         -takefocus-background       -highlightcolor     -text-bitmap           -highlightthickness -underline-borderwidth      -image.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 image or bitmap or text being displayed in it..TP.B -indicatoron \fIboolean\fPSpecifies whether or not the indicator should be drawn.If false, the \f5relief\fP option is ignored and the widget'srelief is always \f5sunken\fP if the widget is selectedand \f5raised\fP otherwise..TP.B -selectcolor \fIcolour\fPSpecifies a background colour to use when the button is selected.If \f5indicatoron\fR is true, the colour applies to the indicator.If \f5indicatoron\fR is false, this colour is used as the backgroundfor the entire widget, in place of \f5background\fR or \f5activebackground\fR,whenever the widget is selected.If specified as an empty string, no special colour is used fordisplaying when the widget is selected..ig.TP.B -selectimage \fIimage\fPSpecifies an image to display (in place of the \f5image\fR option)when the radiobutton is selected.This option is ignored unless the \f5image\fR option has beenspecified....TP.B -state \fIstate\fPSpecifies one of three states for the radiobutton:  \f5normal\fR, \f5active\fR,or \f5disabled\fR.  In normal state the radiobutton is displayed using the\f5foreground\fR and \f5background\fR options.  The active state istypically used when the pointer is over the radiobutton.  In active statethe radiobutton is displayed using the \f5activeforeground\fR and\f5activebackground\fR options.  Disabled state means that the radiobuttonshould be insensitive:  the default bindings will refuse to activatethe widget and will ignore mouse button presses.In this state the \f5disabledcolor\fR and\f5background\fR options determine how the radiobutton is displayed..TP.B -value \fIstring\fPSpecifies value to store in the button's associated variable wheneverthis button is selected..TP.B -variable \fIstring\fPSpecifies name of global variable to set whenever this button isselected.  Changes in this variable also cause the button to selector deselect itself.Defaults to the value \f5selectedButton\fR..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 image or bitmap or text being displayed in it..SH DESCRIPTIONThe \f5radiobutton\fR command creates a new window (given by the\fIpathName\fR argument) and makes it into a radiobutton widget.Additionaloptions, described above, may be specified on the command lineto configure aspects of the radiobutton such as its colours, font,text, and initial relief.  The \f5radiobutton\fR command returns its\fIpathName\fR argument.  At the time this command is invoked,there must not exist a window named \fIpathName\fR..PPA radiobutton is a widget that displays a textual string, bitmap or imageand a diamond called an \fIindicator\fR.If text is displayed, it must all be in a single font, but itcan occupy multiple lines on the screen (if it contains newlines) andone of the characters may optionally be underlined using the\f5underline\fR option.  A radiobutton hasall of the behaviour of a simple button: it can display itself in eitherof three different ways, according to the \f5state\fR option;it can be made to appearraised, sunken, or flat; and it invokesa Tk command whenever mouse button 1 is clicked over thecheck button..PPIn addition, radiobuttons can be \fIselected\fR.If a radiobutton is selected, the indicator is normallydrawn with a sunken relief and a special colour, anda Tk variable associated with the radiobutton is set to a particularvalue.If the radiobutton is not selected, the indicator is drawn with araised relief and no special colour.Typically, several radiobuttons share a single variable and thevalue of the variable indicates which radiobutton is to be selected.When a radiobutton is selected it sets the value of the variable toindicate that fact;  each radiobutton also monitors the value ofthe variable and automatically selects and deselects itself when thevariable's value changes.By default the variable \f5selectedButton\fRis used;  its contents give the name of the button that isselected, or the empty string if no button associated with thatvariable is selected.The name of the variable for a radiobutton,plus the variable to be stored into it, may be modified with optionson the command line.Configuration options may also be used to modify the way theindicator is displayed (or whether it is displayed at all).By default a radiobutton is configured to select itself on button clicks..SH "WIDGET COMMAND"The \f5radiobutton\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 radiobutton 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 \f5radiobutton\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 \f5radiobutton\fRcommand..TP\fIpathName \f5deselect\fRDeselects the radiobutton and sets the associated variable to anempty string.If this radiobutton was not currently selected, the command hasno effect..TP\fIpathName \f5invoke\fRDoes just what would have happened if the user invoked the radiobuttonwith the mouse: selects the button and invokesits associated Tk command, if there is one.The return value is the return value from the Tk command, or anempty string if there is no command associated with the radiobutton.This command is ignored if the radiobutton's state is \f5disabled\fR..TP\fIpathName \f5select\fRSelects the radiobutton and sets the associated variable to thevalue corresponding to this widget. .SH BINDINGSTk automatically creates bindings for radiobuttons that give themthe following default behaviour:.IP [1]The radiobutton activates whenever the mouse passes over it and deactivateswhenever the mouse leaves the radiobutton..IP [2]When mouse button 1 is pressed over a radiobutton it is invoked (itbecomes selected and the command associated with the button isinvoked, if there is one)..PPIf the radiobutton's state is \f5disabled\fR then none of the aboveactions occur:  the radiobutton is completely non-responsive..PPThe behaviour of radiobuttons can be changed by defining new bindings forindividual widgets..SH SEE ALSO.IR button (9),.IR checkbutton (9),.IR choicebutton (9),.IR options (9),.IR types (9)