1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58
|
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>gtk.RadioButton</title><meta name="generator" content="DocBook XSL Stylesheets V1.65.1"><link rel="home" href="index.html" title="PyGTK 2.0 Reference Manual"><link rel="up" href="gtk-class-reference.html" title="The gtk Class Reference"><link rel="previous" href="class-gtkradioaction.html" title="gtk.RadioAction"><link rel="next" href="class-gtkradiomenuitem.html" title="gtk.RadioMenuItem"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">gtk.RadioButton</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="class-gtkradioaction.html">Prev</a></td><th width="60%" align="center">The gtk Class Reference</th><td width="20%" align="right"><a accesskey="n" href="class-gtkradiomenuitem.html">Next</a></td></tr></table><hr></div><div class="refentry" lang="en"><a name="class-gtkradiobutton"></a><div class="titlepage"><div></div><div></div></div><div class="refnamediv"><h2>gtk.RadioButton</h2><p>gtk.RadioButton — a choice of one of multiple check buttons.</p></div><div class="refsect1" lang="en"><a name="id3485913"></a><h2>Synopsis</h2><table bgcolor="#D0E0F0" width="100%"><tr><td><pre class="classsynopsis">class <span class="ooclass"><span class="classname">gtk.RadioButton</span></span>(<span class="ooclass"><span class="classname"><a href="class-gtkcheckbutton.html" title="gtk.CheckButton">gtk.CheckButton</a></span></span>):
<code class="constructorsynopsis"> <span class="methodname"><a href="class-gtkradiobutton.html#constructor-gtkradiobutton" title="Constructor">gtk.RadioButton</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>group</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>use_underline</tt></b></span><span class="initializer">=TRUE</span></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkradiobutton.html#method-gtkradiobutton--get-group" title="gtk.RadioButton.get_group">get_group</a></span>(<span class="methodparam"></span>)</code><br><code class="methodsynopsis"> def <span class="methodname"><a href="class-gtkradiobutton.html#method-gtkradiobutton--set-group" title="gtk.RadioButton.set_group">set_group</a></span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>group</tt></b></span></span>)</code><br></pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3486021"></a><h2>Ancestry</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="synopsis">+-- <a href="class-gobject.html" title="gobject.GObject">gobject.GObject</a>
+-- <a href="class-gtkobject.html" title="gtk.Object">gtk.Object</a>
+-- <a href="class-gtkwidget.html" title="gtk.Widget">gtk.Widget</a>
+-- <a href="class-gtkcontainer.html" title="gtk.Container">gtk.Container</a>
+-- <a href="class-gtkbin.html" title="gtk.Bin">gtk.Bin</a>
+-- <a href="class-gtkbutton.html" title="gtk.Button">gtk.Button</a>
+-- <a href="class-gtktogglebutton.html" title="gtk.ToggleButton">gtk.ToggleButton</a>
+-- <a href="class-gtkcheckbutton.html" title="gtk.CheckButton">gtk.CheckButton</a>
+-- <a href="class-gtkradiobutton.html" title="gtk.RadioButton">gtk.RadioButton</a>
</pre></td></tr></table></div><div class="refsect1" lang="en"><a name="id3486090"></a><h2>Properties</h2><div class="blockquote"><table width="100%" border="0" bgcolor="#E0E0E0"><tr><td valign="top"><div class="informaltable"><table width="100%" border="0"><colgroup><col><col><col></colgroup><tbody><tr valign="top"><td valign="top">"group"</td><td valign="top">Write</td><td valign="top">The group that the radiobutton is in.</td></tr></tbody></table></div></td></tr></table></div></div><div class="refsect1" lang="en"><a name="id3486160"></a><h2>Signal Prototypes</h2><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term">"<a href="class-gtkradiobutton.html#signal-gtkradiobutton--group-changed" title='The "group-changed" gtk.RadioButton Signal'>group-changed</a>"</span></td><td><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>radiobutton</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></td></tr></tbody></table></div><div class="refsect1" lang="en"><a name="id3486212"></a><h2>Description</h2><p>A single <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
performs the same basic function as a <a href="class-gtkcheckbutton.html" title="gtk.CheckButton"><tt class="classname">gtk.CheckButton</tt></a>,
as it's position in the object hierarchy reflects. It is only when multiple
radio buttons are grouped together that they become a different user
interface component in their own right. Every radio button is a member of
some group of radio buttons. When one is selected, all other radio buttons
in the same group are deselected. A <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
is used to give the user a choice of one of many options.</p><p>Radio button widgets are created with <a href="class-gtkradiobutton.html#constructor-gtkradiobutton" title="Constructor">gtk.RadioButton</a>() passing
<tt class="literal">None</tt> as the <i class="parameter"><tt>group</tt></i> (first) argument
if this is the first radio button in a group. In subsequent calls, pass a
reference to a <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
as the first argument to specify the group. The second (optional) argument
to <a href="class-gtkradiobutton.html#constructor-gtkradiobutton" title="Constructor">gtk.RadioButton</a>() is a
label that is used to specify the text of the button. The label text is
parsed for mnemonic characters (preceded by an underscore) to specify an
accelerator for the radiobutton. See <a href="class-gtkaccelgroup.html" title="gtk.AccelGroup"><tt class="classname">gtk.AccelGroup</tt></a>
and <a href="class-gtkaccellabel.html" title="gtk.AccelLabel"><tt class="classname">gtk.AccelLabel</tt></a>
for more information on mnemonic accelerators.</p><p>To retrieve the group a <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
is assigned to, use the <a href="class-gtkradiobutton.html#method-gtkradiobutton--get-group" title="gtk.RadioButton.get_group"><tt class="methodname">get_group</tt>()</a>
method. To remove a <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
from one group and make it part of a new one, use the <a href="class-gtkradiobutton.html#method-gtkradiobutton--set-group" title="gtk.RadioButton.set_group"><tt class="methodname">set_group</tt>()</a>
method.</p></div><div class="refsect1" lang="en"><a name="constructor-gtkradiobutton"></a><h2>Constructor</h2><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="constructorsynopsis"> <span class="methodname">gtk.RadioButton</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>group</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>label</tt></b></span><span class="initializer">=None</span></span>, <span class="methodparam"><span class="parameter"><b class="parameter"><tt>use_underline</tt></b></span><span class="initializer">=TRUE</span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>group</tt></b>:</span></td><td>an existing <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
or <tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>label</tt></b>:</span></td><td>a string to use as the button text or
<tt class="literal">None</tt></td></tr><tr><td><span class="term"><b class="parameter"><tt>use_underline</tt></b>:</span></td><td>if <tt class="literal">TRUE</tt>, an underscore in the
label text indicates the next character should be underlined and used for the
mnemonic accelerator key if it is the first character so
marked. Available in PyGTK 2.4 and above.</td></tr><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>a new <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
widget</td></tr></tbody></table><p>Creates a new <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
widget with the label text specified by <i class="parameter"><tt>label</tt></i>, adding
it to the same group as <i class="parameter"><tt>group</tt></i>.
<i class="parameter"><tt>label</tt></i> is parsed for underscore characters that
indicate mnemonic accelerators. If <i class="parameter"><tt>label</tt></i> is
<tt class="literal">None</tt>, no label is created. If
<i class="parameter"><tt>group</tt></i> is <tt class="literal">None</tt>, the new radiobutton
becomes the first member of a new radiobutton group.</p><p>In PyGTK 2.4 and above the <i class="parameter"><tt>use_underline</tt></i>
parameter is available and defaults to <tt class="literal">TRUE</tt>. If
<i class="parameter"><tt>use_underline</tt></i> is set to <tt class="literal">FALSE</tt> the
label text will not be parsed for mnemonic characters.</p></div><div class="refsect1" lang="en"><a name="id3486557"></a><h2>Methods</h2><div class="refsect2" lang="en"><a name="method-gtkradiobutton--get-group"></a><h3>gtk.RadioButton.get_group</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">get_group</span>(<span class="methodparam"></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><span class="emphasis"><em>Returns</em></span>:</span></td><td>the list of radiobuttons in the same group that
contains the radiobutton</td></tr></tbody></table><p>The <tt class="methodname">get_group</tt>() method returns the list
of radiobuttons that are in the same group as the radiobutton.</p></div><div class="refsect2" lang="en"><a name="method-gtkradiobutton--set-group"></a><h3>gtk.RadioButton.set_group</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">set_group</span>(<span class="methodparam"><span class="parameter"><b class="parameter"><tt>group</tt></b></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><b class="parameter"><tt>group</tt></b>:</span></td><td>a <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
whose group the radiobutton will be added to</td></tr></tbody></table><p>The <tt class="methodname">set_group</tt>() method adds the
radiobutton to the group of the radiobutton specified by
<i class="parameter"><tt>group</tt></i>.</p></div></div><div class="refsect1" lang="en"><a name="id3486690"></a><h2>Signals</h2><div class="refsect2" lang="en"><a name="signal-gtkradiobutton--group-changed"></a><h3>The "group-changed" gtk.RadioButton Signal</h3><table border="0" bgcolor="#E0E0E0" width="100%"><tr><td><pre class="programlisting"><code class="methodsynopsis"> def <span class="methodname">callback</span>(<span class="methodparam"><span class="parameter"><i class="parameter"><tt>radiobutton</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>user_param1</tt></i></span></span>, <span class="methodparam"><span class="parameter"><i class="parameter"><tt>...</tt></i></span></span>)</code></pre></td></tr></table><table border="0" width="100%" bgcolor="#FFECCE"><col align="left" valign="top" width="0*"><tbody><tr><td><span class="term"><i class="parameter"><tt>radiobutton</tt></i>:</span></td><td>the radiobutton that received the
signal</td></tr><tr><td><span class="term"><i class="parameter"><tt>user_param1</tt></i>:</span></td><td>the first user parameter (if any) specified
with the <a href="class-gobject.html#method-gobject--connect" title="gobject.GObject.connect"><tt class="methodname">connect</tt>()</a>
method</td></tr><tr><td><span class="term"><i class="parameter"><tt>...</tt></i>:</span></td><td>additional user parameters (if
any)</td></tr></tbody></table><div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"><h3 class="title">Note</h3><p>This signal is available in GTK+ 2.4 and above.</p></div><p>The "group-changed" signal is emitted when a <a href="class-gtkradiobutton.html" title="gtk.RadioButton"><tt class="classname">gtk.RadioButton</tt></a>
is added to or removed from the group.</p></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="class-gtkradioaction.html">Prev</a></td><td width="20%" align="center"><a accesskey="u" href="gtk-class-reference.html">Up</a></td><td width="40%" align="right"><a accesskey="n" href="class-gtkradiomenuitem.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">gtk.RadioAction</td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top">gtk.RadioMenuItem</td></tr></table></div></body></html>
|