<section ID="chapter.widgets.radiobutton">
  <TITLE>Radiobutton widget</TITLE>

<subsection> <TITLE>Description</TITLE>

<P>
A radiobutton is a widget that displays a textual string, bitmap or image and a diamond or circle called an indicator. If text is displayed, it must all be in a single font, but it can occupy multiple lines on the screen (if it contains newlines or if wrapping occurs because of the wrapLength option) and one of the characters may optionally be underlined using the underline option. A radiobutton has all of the behavior of a simple button: it can display itself in either of three different ways, according to the state option; it can be made to appear raised, sunken, or flat; it can be made to flash; and it invokes an Oz command whenever mouse button 1 is clicked over the check button. 
</P>
<P>
Radiobuttons are grouped together with other radiobuttons, radiobuttons of menus and tbradiobuttons by specifying the same atom to the <<group>> parameter. Only one button of a same group can be on at a time. If a radiobutton is selected, the indicator is normally drawn with a selected appearance. Under Unix, the indicator is drawn with a sunken relief and a special color. Under Windows, the indicator is drawn with a round mark inside. If the radiobutton is not selected, then the indicator is drawn with a deselected appearance, and the associated variable is set to a different value (typically 0). Under Unix, the indicator is drawn with a raised relief and no special color. Under Windows, the indicator is drawn without a round mark inside. 
</P>

<subsection> <TITLE>Parameters</TITLE>

<P>
<LIST>
<ITEM> <<1:B>> : Specifies if the button is on or off. If <<B>> is <<true>> then the button is selelected. All other radiobuttons in the same group are deselected. If <<B>> is false then the button is deselected. This can end in no radiobutton in the same group selected at all. This parameter can be used with the <<set()>> and <<get()>> methods only. <<B>> must be a boolean.

<ITEM> <<init:B>> : Specifies if the button is on or off. If <<B>> is <<true>> then the button is selelected. All other radiobuttons in the same group are deselected. If <<B>> is false then the button is deselected. This can end in no radiobutton in the same group selected at all. This parameter is valid at creation time only. <<B>> must be a boolean.

<ITEM> <<return:V>> : When the window is closed, <<V>> is bound to <<true>> if the radiobutton, false otherwise. This parameter is valid at creation time only. <<V>> must be a free variable.

&param_activebackground;
&param_activeforeground;
&param_anchor;
&param_background;
&param_bitmap;
&param_borderwidth;
&param_cursor;
&param_disabledforeground;
&param_font;
&param_foreground;
&param_highlightbackground;
&param_highlightcolor;
&param_highlightthickness;
&param_image;
&param_justify;
&param_relief;
&param_takefocus;
&param_text;
&param_underline;
&param_wraplength;

<ITEM> <<height:P>> : Specifies a desired height for the button. If an image or bitmap is being displayed in the button then the
    value is in screen units; for text it is in lines of text. If
    this option isn't specified, the button's desired height is computed from the size of the image or bitmap or
    text being displayed in it. <<P>> must be a valid screen distance (see  <ptr to="misc.distance">).

<ITEM> <<indicatoron:B>> : Specifies whether or not the indicator should be drawn. If <<false>>, the relief option is ignored and the widget's relief is always sunken if the widget is selected and raised otherwise. <<B>> must be a boolean.

<ITEM> <<selectcolor:C>> : Specifies a background color to use when the button is selected. If <<indicatoron>> is <<true>> then the color applies to the indicator. Under Windows, this color is used as the background for the indicator regardless of the select state. If <<indicatoron>> is false, this color is used as the background for the entire widget, in place of <<background>> or <<activebackground>>, whenever the widget is selected. <<C>> must be a valid color (see <ptr to="misc.color">).

<ITEM> <<selectimage:I>> : Specifies an image to display (in place of the <<image>> option) when the checkbutton is selected. This option is ignored unless the <<image>> option has been specified. <<I>> must be a valid image (see <ptr to="misc.image">)

<ITEM> <<state:A>> : Specifies one of three states for the button: <<normal>>, <<active>>, or <<disabled>>. In normal state the button is
    displayed using the foreground and background options. The active state is typically used when the
    pointer is over the button. In active state the button is displayed using the activeforeground and
    activebackground options. Disabled state means that the button should be insensitive: the default
    bindings will refuse to activate the widget and will ignore mouse button presses. In this state the
    disabledforeground and background options determine how the button is displayed. <<A>> must be one of these three atoms : <<normal>>, <<active>>, or <<disabled>>.

<ITEM> <<width:P>> : Specifies a desired width for the checkbutton. If an image or bitmap is being displayed in the button then the
    value is in screen units; for text it is in characters. If
    this option isn't specified, the button's desired width is computed from the size of the image or bitmap or
    text being displayed in it. <<P>> must be a valid screen distance (see  <ptr to="misc.distance">).

&param_ipadx;
&param_ipady;

<ITEM> <<action:C>> : Specifies an action to execute juste after the user clicked the button. <<C>> can take several different forms (see <ptr to="basics.events">).

<ITEM> <<group:A>> : Specifies what group the radiobutton belongs to. All radiobuttons that use the same <<A>> belong to the same group (only one can be selected at a time in a group). Valid at necessary at creation time only. <<A>> must be an atom.

&param_glue;
&param_padx;
&param_pady;
&param_feature;
&param_handle;
&param_tooltips;


</LIST>

</P>

<subsection> <TITLE>Interface</TITLE>

<P>
The object you get by an handle on the widget implements the following methods :

<LIST>

&interface_set;
&interface_get;
&interface_bind;
&interface_getFocus;
&interface_setGrab;
&interface_releaseGrab;
&interface_getGrabStatus;
&interface_raise;
&interface_lower;
&interface_winfo;


<ITEM> <<flash>> : Flashes the checkbutton. This is accomplished by redisplaying the checkbutton several times,
    alternating between active and normal colors. At the end of the flash the checkbutton is left in
    the same normal/active state as when the command was invoked. This command is ignored if the
    checkbutton's state is disabled. 


</LIST>


</section>
