1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
5
<title>GtkRadioAction</title>
6
<meta name="generator" content="DocBook XSL Stylesheets V1.72.0">
7
<link rel="start" href="index.html" title="GTK+ Reference Manual">
8
<link rel="up" href="Actions.html" title="Action-based menus and toolbars">
9
<link rel="prev" href="GtkToggleAction.html" title="GtkToggleAction">
10
<link rel="next" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
11
<meta name="generator" content="GTK-Doc V1.7 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
13
<link rel="part" href="gtk.html" title="Part I. GTK+ Overview">
14
<link rel="part" href="gtkbase.html" title="Part II. GTK+ Core Reference">
15
<link rel="part" href="gtkobjects.html" title="Part III. GTK+ Widgets and Objects">
16
<link rel="chapter" href="ch01.html" title="Object Hierarchy">
17
<link rel="chapter" href="ch02.html" title="Widget Gallery">
18
<link rel="chapter" href="WindowWidgets.html" title="Windows">
19
<link rel="chapter" href="DisplayWidgets.html" title="Display Widgets">
20
<link rel="chapter" href="ButtonWidgets.html" title="Buttons and Toggles">
21
<link rel="chapter" href="NumericEntry.html" title="Numeric/Text Data Entry">
22
<link rel="chapter" href="TextWidgetObjects.html" title="Multiline Text Editor">
23
<link rel="chapter" href="TreeWidgetObjects.html" title="Tree, List and Icon Grid Widgets">
24
<link rel="chapter" href="MenusAndCombos.html" title="Menus, Combo Box, Toolbar">
25
<link rel="chapter" href="Actions.html" title="Action-based menus and toolbars">
26
<link rel="chapter" href="SelectorWidgets.html" title="Selectors (File/Font/Color/Input Devices)">
27
<link rel="chapter" href="LayoutContainers.html" title="Layout Containers">
28
<link rel="chapter" href="Ornaments.html" title="Ornaments">
29
<link rel="chapter" href="ScrollingWidgets.html" title="Scrolling">
30
<link rel="chapter" href="Printing.html" title="Printing">
31
<link rel="chapter" href="MiscObjects.html" title="Miscellaneous">
32
<link rel="chapter" href="AbstractObjects.html" title="Abstract Base Classes">
33
<link rel="chapter" href="PlugSocket.html" title="Cross-process Embedding">
34
<link rel="chapter" href="SpecialObjects.html" title="Special-purpose features">
35
<link rel="chapter" href="RecentDocuments.html" title="Recently Used Documents">
36
<link rel="chapter" href="DeprecatedObjects.html" title="Deprecated">
37
<link rel="part" href="migrating.html" title="Part IV. Migrating from Previous Versions of GTK+">
38
<link rel="chapter" href="gtk-migrating-checklist.html" title="Migration Checklist">
39
<link rel="chapter" href="gtk-migrating-GtkFileChooser.html" title="Migrating from GtkFileSelection to GtkFileChooser">
40
<link rel="chapter" href="gtk-migrating-GtkAction.html" title="Migrating from old menu and toolbar systems to GtkAction">
41
<link rel="chapter" href="gtk-migrating-GtkComboBox.html" title="Migrating from GtkOptionMenu and GtkCombo to GtkComboBox and GtkComboBoxEntry">
42
<link rel="chapter" href="gtk-migrating-GtkIconView.html" title="Migrating from GnomeIconList to GtkIconView">
43
<link rel="chapter" href="gtk-migrating-GtkAboutDialog.html" title="Migrating from GnomeAbout to GtkAboutDialog">
44
<link rel="chapter" href="gtk-migrating-GtkColorButton.html" title="Migrating from GnomeColorPicker to GtkColorButton">
45
<link rel="chapter" href="gtk-migrating-GtkAssistant.html" title="Migrating from GnomeDruid to GtkAssistant">
46
<link rel="chapter" href="gtk-migrating-GtkRecentChooser.html" title="Migrating from EggRecent to GtkRecentChooser">
47
<link rel="chapter" href="gtk-migrating-GtkLinkButton.html" title="Migrating from GnomeHRef to GtkLinkButton">
48
<link rel="part" href="pt05.html" title="Part V. GTK+ Tools">
49
<link rel="glossary" href="glossary.html" title="Glossary">
50
<link rel="index" href="ix01.html" title="Index">
51
<link rel="index" href="ix02.html" title="Index of deprecated symbols">
52
<link rel="index" href="ix03.html" title="Index of new symbols in 2.2">
53
<link rel="index" href="ix04.html" title="Index of new symbols in 2.4">
54
<link rel="index" href="ix05.html" title="Index of new symbols in 2.6">
55
<link rel="index" href="ix06.html" title="Index of new symbols in 2.8">
56
<link rel="index" href="ix07.html" title="Index of new symbols in 2.10">
58
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
59
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
61
<td><a accesskey="p" href="GtkToggleAction.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
62
<td><a accesskey="u" href="Actions.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
63
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
64
<th width="100%" align="center">GTK+ Reference Manual</th>
65
<td><a accesskey="n" href="SelectorWidgets.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
67
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id3447128" class="shortcut">Top</a>
69
<a href="#id3447449" class="shortcut">Description</a>
71
<a href="#id3447313" class="shortcut">Object Hierarchy</a>
73
<a href="#id3447352" class="shortcut">Properties</a>
75
<a href="#id3447421" class="shortcut">Signals</a></nobr></td></tr>
77
<div class="refentry" lang="en">
78
<a name="GtkRadioAction"></a><div class="titlepage"></div>
79
<div class="refnamediv"><table width="100%"><tr>
82
<a name="id3447128"></a><span class="refentrytitle">GtkRadioAction</span>
84
<p>GtkRadioAction — An action of which only one in a group can be active</p>
86
<td valign="top" align="right"></td>
88
<div class="refsynopsisdiv">
90
<pre class="synopsis">
92
#include <gtk/gtk.h>
95
<a href="GtkRadioAction.html#GtkRadioAction-struct">GtkRadioAction</a>;
96
<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a>* <a href="GtkRadioAction.html#gtk-radio-action-new">gtk_radio_action_new</a> (const gchar *name,
99
const gchar *stock_id,
101
GSList* <a href="GtkRadioAction.html#gtk-radio-action-get-group">gtk_radio_action_get_group</a> (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action);
102
void <a href="GtkRadioAction.html#gtk-radio-action-set-group">gtk_radio_action_set_group</a> (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action,
104
gint <a href="GtkRadioAction.html#gtk-radio-action-get-current-value">gtk_radio_action_get_current_value</a> (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action);
105
void <a href="GtkRadioAction.html#gtk-radio-action-set-current-value">gtk_radio_action_set_current_value</a> (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action,
111
<div class="refsect1" lang="en">
112
<a name="id3447313"></a><h2>Object Hierarchy</h2>
113
<pre class="synopsis">
116
+----<a href="GtkAction.html" title="GtkAction">GtkAction</a>
117
+----<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a>
121
<div class="refsect1" lang="en">
122
<a name="id3447352"></a><h2>Properties</h2>
123
<pre class="synopsis">
125
"<a href="GtkRadioAction.html#GtkRadioAction--current-value">current-value</a>" gint : Read / Write
126
"<a href="GtkRadioAction.html#GtkRadioAction--group">group</a>" <a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> : Write
127
"<a href="GtkRadioAction.html#GtkRadioAction--value">value</a>" gint : Read / Write
130
<div class="refsect1" lang="en">
131
<a name="id3447421"></a><h2>Signals</h2>
132
<pre class="synopsis">
134
"<a href="GtkRadioAction.html#GtkRadioAction-changed">changed</a>" : Run First / No Recursion
137
<div class="refsect1" lang="en">
138
<a name="id3447449"></a><h2>Description</h2>
140
A <a href="GtkRadioAction.html" title="GtkRadioAction"><span class="type">GtkRadioAction</span></a> is similar to <a href="GtkRadioMenuItem.html" title="GtkRadioMenuItem"><span class="type">GtkRadioMenuItem</span></a>. A number of radio
141
actions can be linked together so that only one may be active at any
145
<div class="refsect1" lang="en">
146
<a name="id3447482"></a><h2>Details</h2>
147
<div class="refsect2" lang="en">
148
<a name="id3447493"></a><h3>
149
<a name="GtkRadioAction-struct"></a>GtkRadioAction</h3>
150
<a class="indexterm" name="id3447506"></a><pre class="programlisting">typedef struct _GtkRadioAction GtkRadioAction;</pre>
152
The <span class="structname">GtkRadioAction</span> struct contains
153
only private members and should not be accessed directly.
157
<div class="refsect2" lang="en">
158
<a name="id3447527"></a><h3>
159
<a name="gtk-radio-action-new"></a>gtk_radio_action_new ()</h3>
160
<a class="indexterm" name="id3447542"></a><pre class="programlisting"><a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a>* gtk_radio_action_new (const gchar *name,
162
const gchar *tooltip,
163
const gchar *stock_id,
166
Creates a new <a href="GtkRadioAction.html" title="GtkRadioAction"><span class="type">GtkRadioAction</span></a> object. To add the action to
167
a <a href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> and set the accelerator for the action,
168
call <a href="GtkActionGroup.html#gtk-action-group-add-action-with-accel"><code class="function">gtk_action_group_add_action_with_accel()</code></a>.</p>
172
<div class="variablelist"><table border="0">
173
<col align="left" valign="top">
176
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
177
<td> A unique name for the action
181
<td><span class="term"><em class="parameter"><code>label</code></em> :</span></td>
182
<td> The label displayed in menu items and on buttons
186
<td><span class="term"><em class="parameter"><code>tooltip</code></em> :</span></td>
187
<td> A tooltip for this action
191
<td><span class="term"><em class="parameter"><code>stock_id</code></em> :</span></td>
192
<td> The stock icon to display in widgets representing this action
196
<td><span class="term"><em class="parameter"><code>value</code></em> :</span></td>
197
<td> The value which <a href="GtkRadioAction.html#gtk-radio-action-get-current-value"><code class="function">gtk_radio_action_get_current_value()</code></a> should return
198
if this action is selected.
202
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
203
<td> a new <a href="GtkRadioAction.html" title="GtkRadioAction"><span class="type">GtkRadioAction</span></a>
209
<p class="since">Since 2.4
213
<div class="refsect2" lang="en">
214
<a name="id3447749"></a><h3>
215
<a name="gtk-radio-action-get-group"></a>gtk_radio_action_get_group ()</h3>
216
<a class="indexterm" name="id3447765"></a><pre class="programlisting">GSList* gtk_radio_action_get_group (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action);</pre>
218
Returns the list representing the radio group for this object.
219
Note that the returned list is only valid until the next change
223
A common way to set up a group of radio group is the following:
225
<div class="informalexample"><pre class="programlisting">
226
GSList *group = NULL;
227
GtkRadioAction *action;
229
while (/* more actions to add */)
231
action = gtk_radio_action_new (...);
233
gtk_radio_action_set_group (action, group);
234
group = gtk_radio_action_get_group (action);
240
<div class="variablelist"><table border="0">
241
<col align="left" valign="top">
244
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
245
<td> the action object
249
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
250
<td> the list representing the radio group for this object
256
<p class="since">Since 2.4
260
<div class="refsect2" lang="en">
261
<a name="id3447854"></a><h3>
262
<a name="gtk-radio-action-set-group"></a>gtk_radio_action_set_group ()</h3>
263
<a class="indexterm" name="id3447870"></a><pre class="programlisting">void gtk_radio_action_set_group (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action,
264
GSList *group);</pre>
266
Sets the radio group for the radio action object.</p>
270
<div class="variablelist"><table border="0">
271
<col align="left" valign="top">
274
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
275
<td> the action object
279
<td><span class="term"><em class="parameter"><code>group</code></em> :</span></td>
280
<td> a list representing a radio group
285
<p class="since">Since 2.4
289
<div class="refsect2" lang="en">
290
<a name="id3447950"></a><h3>
291
<a name="gtk-radio-action-get-current-value"></a>gtk_radio_action_get_current_value ()</h3>
292
<a class="indexterm" name="id3447967"></a><pre class="programlisting">gint gtk_radio_action_get_current_value (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action);</pre>
294
Obtains the value property of the currently active member of
295
the group to which <em class="parameter"><code>action</code></em> belongs.</p>
299
<div class="variablelist"><table border="0">
300
<col align="left" valign="top">
303
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
304
<td> a <a href="GtkRadioAction.html" title="GtkRadioAction"><span class="type">GtkRadioAction</span></a>
308
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
309
<td> The value of the currently active group member
315
<p class="since">Since 2.4
319
<div class="refsect2" lang="en">
320
<a name="id3448049"></a><h3>
321
<a name="gtk-radio-action-set-current-value"></a>gtk_radio_action_set_current_value ()</h3>
322
<a class="indexterm" name="id3448066"></a><pre class="programlisting">void gtk_radio_action_set_current_value (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action,
323
gint current_value);</pre>
325
Sets the currently active group member to the member with value
326
property <em class="parameter"><code>current_value</code></em>.</p>
330
<div class="variablelist"><table border="0">
331
<col align="left" valign="top">
334
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
335
<td> a <a href="GtkRadioAction.html" title="GtkRadioAction"><span class="type">GtkRadioAction</span></a>
339
<td><span class="term"><em class="parameter"><code>current_value</code></em> :</span></td>
345
<p class="since">Since 2.10
349
<div class="refsect1" lang="en">
350
<a name="id3448161"></a><h2>Property Details</h2>
351
<div class="refsect2" lang="en">
352
<a name="id3448172"></a><h3>
353
<a name="GtkRadioAction--current-value"></a>The "<code class="literal">current-value</code>" property</h3>
354
<a class="indexterm" name="id3448189"></a><pre class="programlisting"> "current-value" gint : Read / Write</pre>
356
The value property of the currently active member of the group to which
357
this action belongs.</p>
361
<p>Default value: 0</p>
366
<div class="refsect2" lang="en">
367
<a name="id3448225"></a><h3>
368
<a name="GtkRadioAction--group"></a>The "<code class="literal">group</code>" property</h3>
369
<a class="indexterm" name="id3448242"></a><pre class="programlisting"> "group" <a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> : Write</pre>
371
Sets a new group for a radio action.</p>
379
<div class="refsect2" lang="en">
380
<a name="id3448275"></a><h3>
381
<a name="GtkRadioAction--value"></a>The "<code class="literal">value</code>" property</h3>
382
<a class="indexterm" name="id3448291"></a><pre class="programlisting"> "value" gint : Read / Write</pre>
384
The value is an arbitrary integer which can be used as a
385
convenient way to determine which action in the group is
386
currently active in an ::activate or ::changed signal handler.
387
See <a href="GtkRadioAction.html#gtk-radio-action-get-current-value"><code class="function">gtk_radio_action_get_current_value()</code></a> and <a href="GtkActionGroup.html#GtkRadioActionEntry"><span class="type">GtkRadioActionEntry</span></a>
388
for convenient ways to get and set this property.</p>
392
<p>Default value: 0</p>
397
<div class="refsect1" lang="en">
398
<a name="id3448352"></a><h2>Signal Details</h2>
399
<div class="refsect2" lang="en">
400
<a name="id3448363"></a><h3>
401
<a name="GtkRadioAction-changed"></a>The "changed" signal</h3>
402
<a class="indexterm" name="id3448373"></a><pre class="programlisting">void user_function (<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *action,
403
<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a> *current,
404
gpointer user_data) : Run First / No Recursion</pre>
406
The ::changed signal is emitted on every member of a radio group when the
407
active member is changed. The signal gets emitted after the ::activate signals
408
for the previous and current active members.</p>
412
<div class="variablelist"><table border="0">
413
<col align="left" valign="top">
416
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
417
<td> the action on which the signal is emitted
421
<td><span class="term"><em class="parameter"><code>current</code></em> :</span></td>
422
<td> the member of <em class="parameter"><code>action</code></em>s group which has just been activated
426
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
427
<td>user data set when the signal handler was connected.</td>