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>GtkToggleAction</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="GtkAction.html" title="GtkAction">
10
<link rel="next" href="GtkRadioAction.html" title="GtkRadioAction">
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="GtkAction.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="GtkRadioAction.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="#id3444650" class="shortcut">Top</a>
69
<a href="#id3444970" class="shortcut">Description</a>
71
<a href="#id3444851" class="shortcut">Object Hierarchy</a>
73
<a href="#id3444890" class="shortcut">Properties</a>
75
<a href="#id3444942" class="shortcut">Signals</a></nobr></td></tr>
77
<div class="refentry" lang="en">
78
<a name="GtkToggleAction"></a><div class="titlepage"></div>
79
<div class="refnamediv"><table width="100%"><tr>
82
<a name="id3444650"></a><span class="refentrytitle">GtkToggleAction</span>
84
<p>GtkToggleAction — An action which can be toggled between two states</p>
86
<td valign="top" align="right"></td>
88
<div class="refsynopsisdiv">
90
<pre class="synopsis">
92
#include <gtk/gtk.h>
95
<a href="GtkToggleAction.html#GtkToggleAction-struct">GtkToggleAction</a>;
96
<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a>* <a href="GtkToggleAction.html#gtk-toggle-action-new">gtk_toggle_action_new</a> (const gchar *name,
99
const gchar *stock_id);
100
void <a href="GtkToggleAction.html#gtk-toggle-action-toggled">gtk_toggle_action_toggled</a> (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);
101
void <a href="GtkToggleAction.html#gtk-toggle-action-set-active">gtk_toggle_action_set_active</a> (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action,
103
gboolean <a href="GtkToggleAction.html#gtk-toggle-action-get-active">gtk_toggle_action_get_active</a> (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);
104
void <a href="GtkToggleAction.html#gtk-toggle-action-set-draw-as-radio">gtk_toggle_action_set_draw_as_radio</a> (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action,
105
gboolean draw_as_radio);
106
gboolean <a href="GtkToggleAction.html#gtk-toggle-action-get-draw-as-radio">gtk_toggle_action_get_draw_as_radio</a> (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);
111
<div class="refsect1" lang="en">
112
<a name="id3444851"></a><h2>Object Hierarchy</h2>
113
<pre class="synopsis">
116
+----<a href="GtkAction.html" title="GtkAction">GtkAction</a>
118
+----<a href="GtkRadioAction.html" title="GtkRadioAction">GtkRadioAction</a>
121
<div class="refsect1" lang="en">
122
<a name="id3444890"></a><h2>Properties</h2>
123
<pre class="synopsis">
125
"<a href="GtkToggleAction.html#GtkToggleAction--active">active</a>" gboolean : Read / Write
126
"<a href="GtkToggleAction.html#GtkToggleAction--draw-as-radio">draw-as-radio</a>" gboolean : Read / Write
129
<div class="refsect1" lang="en">
130
<a name="id3444942"></a><h2>Signals</h2>
131
<pre class="synopsis">
133
"<a href="GtkToggleAction.html#GtkToggleAction-toggled">toggled</a>" : Run First
136
<div class="refsect1" lang="en">
137
<a name="id3444970"></a><h2>Description</h2>
139
A <a href="GtkToggleAction.html" title="GtkToggleAction"><span class="type">GtkToggleAction</span></a> corresponds roughly to a <a href="GtkCheckMenuItem.html" title="GtkCheckMenuItem"><span class="type">GtkCheckMenuItem</span></a>. It has an
140
"active" state specifying whether the action has been checked or not.
143
<div class="refsect1" lang="en">
144
<a name="id3445002"></a><h2>Details</h2>
145
<div class="refsect2" lang="en">
146
<a name="id3445012"></a><h3>
147
<a name="GtkToggleAction-struct"></a>GtkToggleAction</h3>
148
<a class="indexterm" name="id3445026"></a><pre class="programlisting">typedef struct _GtkToggleAction GtkToggleAction;</pre>
150
The <span class="structname">GtkToggleAction</span> struct contains only
151
private members and should not be accessed directly.
155
<div class="refsect2" lang="en">
156
<a name="id3445047"></a><h3>
157
<a name="gtk-toggle-action-new"></a>gtk_toggle_action_new ()</h3>
158
<a class="indexterm" name="id3445061"></a><pre class="programlisting"><a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a>* gtk_toggle_action_new (const gchar *name,
160
const gchar *tooltip,
161
const gchar *stock_id);</pre>
163
Creates a new <a href="GtkToggleAction.html" title="GtkToggleAction"><span class="type">GtkToggleAction</span></a> object. To add the action to
164
a <a href="GtkActionGroup.html" title="GtkActionGroup"><span class="type">GtkActionGroup</span></a> and set the accelerator for the action,
165
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>
169
<div class="variablelist"><table border="0">
170
<col align="left" valign="top">
173
<td><span class="term"><em class="parameter"><code>name</code></em> :</span></td>
174
<td> A unique name for the action
178
<td><span class="term"><em class="parameter"><code>label</code></em> :</span></td>
179
<td> The label displayed in menu items and on buttons
183
<td><span class="term"><em class="parameter"><code>tooltip</code></em> :</span></td>
184
<td> A tooltip for the action
188
<td><span class="term"><em class="parameter"><code>stock_id</code></em> :</span></td>
189
<td> The stock icon to display in widgets representing the action
193
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
194
<td> a new <a href="GtkToggleAction.html" title="GtkToggleAction"><span class="type">GtkToggleAction</span></a>
200
<p class="since">Since 2.4
204
<div class="refsect2" lang="en">
205
<a name="id3445234"></a><h3>
206
<a name="gtk-toggle-action-toggled"></a>gtk_toggle_action_toggled ()</h3>
207
<a class="indexterm" name="id3445250"></a><pre class="programlisting">void gtk_toggle_action_toggled (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);</pre>
209
Emits the "toggled" signal on the toggle action.</p>
213
<div class="variablelist"><table border="0">
214
<col align="left" valign="top">
216
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
217
<td> the action object
221
<p class="since">Since 2.4
225
<div class="refsect2" lang="en">
226
<a name="id3445307"></a><h3>
227
<a name="gtk-toggle-action-set-active"></a>gtk_toggle_action_set_active ()</h3>
228
<a class="indexterm" name="id3445323"></a><pre class="programlisting">void gtk_toggle_action_set_active (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action,
229
gboolean is_active);</pre>
231
Sets the checked state on the toggle action.</p>
235
<div class="variablelist"><table border="0">
236
<col align="left" valign="top">
239
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
240
<td> the action object
244
<td><span class="term"><em class="parameter"><code>is_active</code></em> :</span></td>
245
<td> whether the action should be checked or not
250
<p class="since">Since 2.4
254
<div class="refsect2" lang="en">
255
<a name="id3445404"></a><h3>
256
<a name="gtk-toggle-action-get-active"></a>gtk_toggle_action_get_active ()</h3>
257
<a class="indexterm" name="id3445419"></a><pre class="programlisting">gboolean gtk_toggle_action_get_active (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);</pre>
259
Returns the checked state of the toggle action.</p>
263
<div class="variablelist"><table border="0">
264
<col align="left" valign="top">
267
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
268
<td> the action object
272
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
273
<td> the checked state of the toggle action
279
<p class="since">Since 2.4
283
<div class="refsect2" lang="en">
284
<a name="id3445488"></a><h3>
285
<a name="gtk-toggle-action-set-draw-as-radio"></a>gtk_toggle_action_set_draw_as_radio ()</h3>
286
<a class="indexterm" name="id3445504"></a><pre class="programlisting">void gtk_toggle_action_set_draw_as_radio (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action,
287
gboolean draw_as_radio);</pre>
289
Sets whether the action should have proxies like a radio action.</p>
293
<div class="variablelist"><table border="0">
294
<col align="left" valign="top">
297
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
298
<td> the action object
302
<td><span class="term"><em class="parameter"><code>draw_as_radio</code></em> :</span></td>
303
<td> whether the action should have proxies like a radio
309
<p class="since">Since 2.4
313
<div class="refsect2" lang="en">
314
<a name="id3445585"></a><h3>
315
<a name="gtk-toggle-action-get-draw-as-radio"></a>gtk_toggle_action_get_draw_as_radio ()</h3>
316
<a class="indexterm" name="id3445602"></a><pre class="programlisting">gboolean gtk_toggle_action_get_draw_as_radio (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *action);</pre>
318
Returns whether the action should have proxies like a radio action.</p>
322
<div class="variablelist"><table border="0">
323
<col align="left" valign="top">
326
<td><span class="term"><em class="parameter"><code>action</code></em> :</span></td>
327
<td> the action object
331
<td><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></td>
332
<td> whether the action should have proxies like a radio action.
338
<p class="since">Since 2.4
342
<div class="refsect1" lang="en">
343
<a name="id3445672"></a><h2>Property Details</h2>
344
<div class="refsect2" lang="en">
345
<a name="id3445682"></a><h3>
346
<a name="GtkToggleAction--active"></a>The "<code class="literal">active</code>" property</h3>
347
<a class="indexterm" name="id3445699"></a><pre class="programlisting"> "active" gboolean : Read / Write</pre>
349
If the toggle action should be active in or not.</p>
353
<p>Default value: FALSE</p>
358
<div class="refsect2" lang="en">
359
<a name="id3445736"></a><h3>
360
<a name="GtkToggleAction--draw-as-radio"></a>The "<code class="literal">draw-as-radio</code>" property</h3>
361
<a class="indexterm" name="id3445752"></a><pre class="programlisting"> "draw-as-radio" gboolean : Read / Write</pre>
362
<p>Whether the proxies for this action look like radio action proxies.</p>
363
<p>Default value: FALSE</p>
366
<div class="refsect1" lang="en">
367
<a name="id3445781"></a><h2>Signal Details</h2>
368
<div class="refsect2" lang="en">
369
<a name="id3445791"></a><h3>
370
<a name="GtkToggleAction-toggled"></a>The "toggled" signal</h3>
371
<a class="indexterm" name="id3445802"></a><pre class="programlisting">void user_function (<a href="GtkToggleAction.html" title="GtkToggleAction">GtkToggleAction</a> *toggleaction,
372
gpointer user_data) : Run First</pre>
376
<div class="variablelist"><table border="0">
377
<col align="left" valign="top">
380
<td><span class="term"><em class="parameter"><code>toggleaction</code></em> :</span></td>
381
<td>the object which received the signal.
386
<td><span class="term"><em class="parameter"><code>user_data</code></em> :</span></td>
387
<td>user data set when the signal handler was connected.</td>