ActiveTcl User Guide

Table of Contents

iwidgets::radiobox pathName ?options? itk::Widget <- iwid- gets::Labeledframe <- iwidgets::Radiobox
background borderWidth cursor disabledForeground foreground relief selectColor

See the options manual entry for details on the standard op-

tions.
labelBitmap labelFont labelImage labelMargin

labelPos
labelText labelVariable

See the labeledframe class manual entry for details on the in-

herited options.

Name: command

Class: Command

Command-Line Switch: -command

Specifies a Tcl command procedure to be evaluated following a

change in the current radio box selection.

Name: orient

Class: Orient

Command-Line Switch: -orient

Default Value: vertical

Specifies the orientation of the radiobuttons within the ra-

diobox. Valid values are either horizontal or vertical". _________________________________________________________________

The iwidgets::radiobox command creates a radio button box widget

capable of adding, inserting, deleting, selecting, and configur- ing radiobuttons as well as obtaining the currently selected but- ton.

The iwidgets::radiobox command creates a new Tcl command whose

name is pathName. This command may be used to invoke various op- erations on the widget. It has the following general form:

pathName option ?arg arg ...?

Option and the args determine the exact behavior of the command.

Many of the widget commands for the radiobox take as one argument

an indicator of which radiobutton of the radiobox to operate on.

These indicators are called indexes and allow reference and ma-

nipulation of radiobuttons. Radiobox indexes may be specified in any of the following forms: number Specifies the radiobutton nu- merically, where 0 corresponds to the top radiobutton of the ra- diobox. end Indicates the last radiobutton of the radiobox. pattern If the index doesn't satisfy one of the above forms then this form is used. Pattern is pattern-matched against the tag of each radiobutton in the radiobox, in order from top to bottom, until a matching entry is found. The rules of Tcl_StringMatch are used.

pathName add tag ?option value option value? Adds a new ra- diobutton to the radiobuttond window on the bottom. The command takes additional options which are passed on to the radiobutton as construction arguments. These include the standard Tk ra- diobutton options. The tag is returned. pathName buttonconfig*- ure index ?options? This command is similar to the configure command, except that it applies to the options for an individual radiobutton, whereas configureapplies to the options for the ra- diobox as a whole. Options may have any of the values accepted by the add widget command. If options are specified, options are modified as indicated in the command and the command returns an empty string. If no options are specified, returns a list de- scribing the current options for entry index (see Tk_ConfigureIn*- fo for information on the format of this list). pathName cget option Returns the current value of the configuration option giv- en by option. Option may have any of the values accepted by the iwidgets::radiobox command. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is speci- fied with no value, then the command returns a list describing the one named option (this list will be identical to the corre- sponding sublist of the value returned if no option is speci- fied). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Op- tion may have any of the values accepted by the iwidgets::ra*- diobox command. pathName delete index Deletes a specified ra- diobutton given an index. pathName deselect index Deselects a specified radiobutton given an index. pathName flash index

Flashes a specified radiobutton given an index. pathName get Re-

turns the tag of the currently selected radiobutton. pathName index index Returns the numerical index corresponding to index. pathName insert index tag ?option value option value ...? Same as the add command except that it inserts the new radiobutton just before the one given by index, instead of appending to the end of the radiobox. The option, and value arguments have the same interpretation as for the add widget command. pathName se*- lect index Selects a specified radiobutton given an index.

package require Iwidgets 4.0
iwidgets::radiobox .rb -labeltext Fonts
.rb add times -text Times
.rb add helvetica -text Helvetica
.rb add courier -text Courier
.rb add symbol -text Symbol
.rb select courier

pack .rb -padx 10 -pady 10 -fill both -expand yes

Michael J. McLennan

Mark L. Ulferts radiobox, widget


Table of Contents