1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
4
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
6
<meta name="generator" content="DocBook XSL Stylesheets V1.77.1">
7
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
8
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
9
<link rel="prev" href="gtk-Feature-Test-Macros.html" title="Version Information">
10
<link rel="next" href="gtk-Types.html" title="Types">
11
<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)">
12
<link rel="stylesheet" href="style.css" type="text/css">
14
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
15
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
17
<td><a accesskey="p" href="gtk-Feature-Test-Macros.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
18
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
19
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
20
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
21
<td><a accesskey="n" href="gtk-Types.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
23
<tr><td colspan="5" class="shortcuts">
24
<a href="#gtk-Signals.synopsis" class="shortcut">Top</a>
26
<a href="#gtk-Signals.description" class="shortcut">Description</a>
29
<div class="refentry">
30
<a name="gtk-Signals"></a><div class="titlepage"></div>
31
<div class="refnamediv"><table width="100%"><tr>
33
<h2><span class="refentrytitle"><a name="gtk-Signals.top_of_page"></a>Signals</span></h2>
34
<p>Signals — Object methods and callbacks</p>
36
<td valign="top" align="right"></td>
38
<div class="refsynopsisdiv">
39
<a name="gtk-Signals.synopsis"></a><h2>Synopsis</h2>
40
<pre class="synopsis">
41
#include <gtk/gtk.h>
43
#define <a class="link" href="gtk-Signals.html#GTK-SIGNAL-OFFSET:CAPS" title="GTK_SIGNAL_OFFSET">GTK_SIGNAL_OFFSET</a>
44
enum <a class="link" href="gtk-Signals.html#GtkSignalRunType" title="enum GtkSignalRunType">GtkSignalRunType</a>;
45
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gtk-Signals.html#gtk-signal-new" title="gtk_signal_new ()">gtk_signal_new</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
46
<em class="parameter"><code><a class="link" href="gtk-Signals.html#GtkSignalRunType" title="enum GtkSignalRunType"><span class="type">GtkSignalRunType</span></a> signal_flags</code></em>,
47
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> object_type</code></em>,
48
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> function_offset</code></em>,
49
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GSignalCMarshaller"><span class="type">GSignalCMarshaller</span></a> marshaller</code></em>,
50
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_val</code></em>,
51
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_args</code></em>,
52
<em class="parameter"><code>...</code></em>);
53
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gtk-Signals.html#gtk-signal-newv" title="gtk_signal_newv ()">gtk_signal_newv</a> (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
54
<em class="parameter"><code><a class="link" href="gtk-Signals.html#GtkSignalRunType" title="enum GtkSignalRunType"><span class="type">GtkSignalRunType</span></a> signal_flags</code></em>,
55
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> object_type</code></em>,
56
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> function_offset</code></em>,
57
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GSignalCMarshaller"><span class="type">GSignalCMarshaller</span></a> marshaller</code></em>,
58
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_val</code></em>,
59
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_args</code></em>,
60
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> *args</code></em>);
61
#define <a class="link" href="gtk-Signals.html#gtk-signal-lookup" title="gtk_signal_lookup()">gtk_signal_lookup</a> (name,
63
#define <a class="link" href="gtk-Signals.html#gtk-signal-name" title="gtk_signal_name()">gtk_signal_name</a> (signal_id)
64
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-emit" title="gtk_signal_emit ()">gtk_signal_emit</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
65
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signal_id</code></em>,
66
<em class="parameter"><code>...</code></em>);
67
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-emit-by-name" title="gtk_signal_emit_by_name ()">gtk_signal_emit_by_name</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
68
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
69
<em class="parameter"><code>...</code></em>);
70
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-emitv" title="gtk_signal_emitv ()">gtk_signal_emitv</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
71
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signal_id</code></em>,
72
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkArg" title="struct GtkArg"><span class="type">GtkArg</span></a> *args</code></em>);
73
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-emitv-by-name" title="gtk_signal_emitv_by_name ()">gtk_signal_emitv_by_name</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
74
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
75
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkArg" title="struct GtkArg"><span class="type">GtkArg</span></a> *args</code></em>);
76
#define <a class="link" href="gtk-Signals.html#gtk-signal-emit-stop" title="gtk_signal_emit_stop()">gtk_signal_emit_stop</a> (object,
78
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-emit-stop-by-name" title="gtk_signal_emit_stop_by_name ()">gtk_signal_emit_stop_by_name</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
79
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);
80
#define <a class="link" href="gtk-Signals.html#gtk-signal-connect" title="gtk_signal_connect()">gtk_signal_connect</a> (object,
84
#define <a class="link" href="gtk-Signals.html#gtk-signal-connect-after" title="gtk_signal_connect_after()">gtk_signal_connect_after</a> (object,
88
#define <a class="link" href="gtk-Signals.html#gtk-signal-connect-object" title="gtk_signal_connect_object()">gtk_signal_connect_object</a> (object,
92
#define <a class="link" href="gtk-Signals.html#gtk-signal-connect-object-after" title="gtk_signal_connect_object_after()">gtk_signal_connect_object_after</a> (object,
96
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gulong"><span class="returnvalue">gulong</span></a> <a class="link" href="gtk-Signals.html#gtk-signal-connect-full" title="gtk_signal_connect_full ()">gtk_signal_connect_full</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
97
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
98
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
99
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> unsupported</code></em>,
100
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
101
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_func</code></em>,
102
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> object_signal</code></em>,
103
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> after</code></em>);
104
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-connect-while-alive" title="gtk_signal_connect_while_alive ()">gtk_signal_connect_while_alive</a> (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
105
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
106
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
107
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>,
108
<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *alive_object</code></em>);
109
<span class="returnvalue">void</span> <a class="link" href="gtk-Signals.html#gtk-signal-connect-object-while-alive" title="gtk_signal_connect_object_while_alive ()">gtk_signal_connect_object_while_alive</a>
110
(<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
111
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
112
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
113
<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *alive_object</code></em>);
114
#define <a class="link" href="gtk-Signals.html#gtk-signal-disconnect" title="gtk_signal_disconnect()">gtk_signal_disconnect</a> (object,
116
#define <a class="link" href="gtk-Signals.html#gtk-signal-disconnect-by-func" title="gtk_signal_disconnect_by_func()">gtk_signal_disconnect_by_func</a> (object,
119
#define <a class="link" href="gtk-Signals.html#gtk-signal-disconnect-by-data" title="gtk_signal_disconnect_by_data()">gtk_signal_disconnect_by_data</a> (object,
121
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-block" title="gtk_signal_handler_block()">gtk_signal_handler_block</a> (object,
123
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-block-by-func" title="gtk_signal_handler_block_by_func()">gtk_signal_handler_block_by_func</a> (object,
126
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-block-by-data" title="gtk_signal_handler_block_by_data()">gtk_signal_handler_block_by_data</a> (object,
128
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-unblock" title="gtk_signal_handler_unblock()">gtk_signal_handler_unblock</a> (object,
130
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-unblock-by-func" title="gtk_signal_handler_unblock_by_func()">gtk_signal_handler_unblock_by_func</a> (object,
133
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-unblock-by-data" title="gtk_signal_handler_unblock_by_data()">gtk_signal_handler_unblock_by_data</a> (object,
135
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-pending" title="gtk_signal_handler_pending()">gtk_signal_handler_pending</a> (object,
138
#define <a class="link" href="gtk-Signals.html#gtk-signal-handler-pending-by-func" title="gtk_signal_handler_pending_by_func()">gtk_signal_handler_pending_by_func</a> (object,
143
#define <a class="link" href="gtk-Signals.html#gtk-signal-default-marshaller" title="gtk_signal_default_marshaller">gtk_signal_default_marshaller</a>
146
<div class="refsect1">
147
<a name="gtk-Signals.description"></a><h2>Description</h2>
149
The GTK+ signal system merely proxies the GLib signal system now. For future
150
usage, direct use of the <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html">GSignal</a> API is recommended, this avoids significant
151
performance hits where <a class="link" href="gtk-Types.html#GtkArg" title="struct GtkArg"><span class="type">GtkArg</span></a> structures have to be converted into <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Generic-values.html#GValue"><span class="type">GValue</span></a>s.
153
<div class="refsect2">
154
<a name="idp22519232"></a><h3>What are signals?</h3>
156
Signals are a way to get notification when something happens
157
and to customize object behavior according to the
159
Every <em class="wordasword">signal</em> is uniquely identified by a name,
160
"class_name::signal_name", where signal_name might be something like
161
"clicked" and class_name might be "GtkButton". Note that some other class
162
may also define a "clicked" callback, so long as it doesn't derive from
163
<a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>.
166
When they are created, they are also assigned a unique positive integer,
167
the signal id (1 is the first signal id- 0 is used to flag an error).
168
Each is also tied to an array of types that describes
169
the prototype of the function pointer(s) (handlers) you may
170
connect to the signal. Finally, every signal has
171
a default handler that is given by a function pointer
172
in its class structure: it is run by default whenever the
173
signal is emitted. (It is possible that a signal will
174
be emitted and a user-defined handler will prevent the default handler
178
Signals are used by everyone, but they are only
179
created on a per class basis -- so you should not call
180
call <a class="link" href="gtk-Signals.html#gtk-signal-new" title="gtk_signal_new ()"><code class="function">gtk_signal_new()</code></a> unless you are writing
181
a new <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> type. However, if you want to make a new signal
182
for an existing type, you may use <code class="function">gtk_object_class_user_signal_new()</code>
183
to create a signal that doesn't correspond to a class's builtin
188
<div class="refsect2">
189
<a name="idp24066448"></a><h3>How are signals used?</h3>
191
There are two basic actions in the signal handling game.
192
If you want notification of an event, you must <span class="emphasis"><em>connect</em></span>
193
a function pointer and a data pointer to that signal; the data pointer
194
will be passed as the last argument to the function (so long as you
195
are using the default marshalling functions).
196
You will receive a connection id, a unique positive integer
197
corresponding to that attachment.
200
Functions that want to notify the user of certain actions,
201
<span class="emphasis"><em>emit</em></span> signals.
205
<div class="refsect2">
206
<a name="idp24069472"></a><h3>Basic Terminology</h3>
207
<div class="variablelist"><table border="0" class="variablelist">
209
<col align="left" valign="top">
214
<td><p><span class="term">signal</span></p></td>
215
<td><p>A class method, e.g. GtkButton::clicked.
216
More precisely it is a unique class-branch/signal-name pair.
217
This means you may not define a signal handler for a class which
218
derives from <a class="link" href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a> that is called clicked,
219
but it is okay to share signals names if they are separate in
224
<td><p><span class="term">default handler</span></p></td>
225
<td><p>The object's internal method which is invoked
226
when the signal is emitted.</p></td>
229
<td><p><span class="term">user-defined handler</span></p></td>
231
<p>A function pointer and data connected
232
to a signal (for a particular object).</p>
233
<p>There are really two types: those which are connected
234
normally, and those which are connected by one
235
of the connect_after functions. The connect_after handlers
236
are always run after the default handler.</p>
237
<p>Many toolkits refer to these as <em class="wordasword">callbacks</em>.</p>
241
<td><p><span class="term">emission</span></p></td>
242
<td><p>the whole process of emitting a signal,
243
including the invocation of all
244
the different handler types mentioned above.</p></td>
247
<td><p><span class="term">signal id</span></p></td>
248
<td><p>The unique positive (nonzero) integer
249
used to identify a signal. It can be used instead of
250
a name to many functions for a slight performance
251
improvement.</p></td>
254
<td><p><span class="term">connection id</span></p></td>
255
<td><p>The unique positive (nonzero) integer
256
used to identify the connection of a user-defined handler
257
to a signal. Notice that it is allowed to connect the
258
same function-pointer/user-data pair twice, so
259
there is no guarantee that a function-pointer/user-data
260
maps to a unique connection id.
267
<div class="refsect2">
268
<a name="idp20981808"></a><h3>A brief note on how they work.</h3>
270
The functions responsible for translating an array of <a href="gtk-Types.html#GtkArg"><span class="type">GtkArgs</span></a>
271
to your C compiler's normal semantics are called Marshallers.
272
They are identified by
273
gtk_marshal_<em class="replaceable"><code>return_value</code></em>__<em class="replaceable"><code>parameter_list</code></em>()
274
for example a C function returning a gboolean and taking a gint
275
can be invoked by using <code class="function">gtk_marshal_BOOL__INT()</code>.
276
Not all possibly combinations of return/params are available,
277
of course, so if you are writing a <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> with parameters
278
you might have to write a marshaller.
282
<div class="refsect1">
283
<a name="gtk-Signals.details"></a><h2>Details</h2>
284
<div class="refsect2">
285
<a name="GTK-SIGNAL-OFFSET:CAPS"></a><h3>GTK_SIGNAL_OFFSET</h3>
286
<pre class="programlisting">#define GTK_SIGNAL_OFFSET G_STRUCT_OFFSET
288
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
289
<h3 class="title">Warning</h3>
290
<p><code class="literal">GTK_SIGNAL_OFFSET</code> is deprecated and should not be used in newly-written code.</p>
293
Use in place of <code class="function"><code class="function">offsetof()</code></code>, which is used if it exists.
297
<div class="refsect2">
298
<a name="GtkSignalRunType"></a><h3>enum GtkSignalRunType</h3>
299
<pre class="programlisting">typedef enum {
300
GTK_RUN_FIRST = G_SIGNAL_RUN_FIRST,
301
GTK_RUN_LAST = G_SIGNAL_RUN_LAST,
302
GTK_RUN_BOTH = (GTK_RUN_FIRST | GTK_RUN_LAST),
303
GTK_RUN_NO_RECURSE = G_SIGNAL_NO_RECURSE,
304
GTK_RUN_ACTION = G_SIGNAL_ACTION,
305
GTK_RUN_NO_HOOKS = G_SIGNAL_NO_HOOKS
308
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
309
<h3 class="title">Warning</h3>
310
<p><code class="literal">GtkSignalRunType</code> is deprecated and should not be used in newly-written code.</p>
313
These configure the signal's emission. They control
314
whether the signal can be emitted recursively on an object
316
whether to run the default method before or after the user-defined handlers.
318
<div class="variablelist"><table border="0" class="variablelist">
320
<col align="left" valign="top">
325
<td><p><span class="term">GTK_RUN_FIRST</span></p></td>
326
<td><p>Run the default handler before the connected user-defined
331
<td><p><span class="term">GTK_RUN_LAST</span></p></td>
332
<td><p>Run the default handler after the connected
333
user-defined handlers.
334
(Handlers registered as "after" always run after the default handler though)
338
<td><p><span class="term">GTK_RUN_BOTH</span></p></td>
339
<td><p>Run the default handler twice,
340
once before the user-defined handlers,
346
<td><p><span class="term">GTK_RUN_NO_RECURSE</span></p></td>
348
<p>Whether to prevent a handler or hook
349
from reemitting the signal from within itself.
351
emit the signal while it is running will result in the signal
352
emission being restarted once it is done with the current processing.
356
careful to avoid having two handlers endlessly reemitting signals,
357
<code class="function">gtk_signal_n_emissions()</code> can be helpful.
362
<td><p><span class="term">GTK_RUN_ACTION</span></p></td>
363
<td><p>The signal is an action you can
364
invoke without any particular setup or cleanup.
365
The signal is treated no differently, but some
366
other code can determine if the signal is appropriate to
367
delegate to user control. For example, key binding sets
368
only allow bindings of ACTION signals to keystrokes.
372
<td><p><span class="term">GTK_RUN_NO_HOOKS</span></p></td>
373
<td><p>This prevents the connection of emission hooks
381
<div class="refsect2">
382
<a name="gtk-signal-new"></a><h3>gtk_signal_new ()</h3>
383
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_signal_new (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
384
<em class="parameter"><code><a class="link" href="gtk-Signals.html#GtkSignalRunType" title="enum GtkSignalRunType"><span class="type">GtkSignalRunType</span></a> signal_flags</code></em>,
385
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> object_type</code></em>,
386
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> function_offset</code></em>,
387
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GSignalCMarshaller"><span class="type">GSignalCMarshaller</span></a> marshaller</code></em>,
388
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_val</code></em>,
389
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_args</code></em>,
390
<em class="parameter"><code>...</code></em>);</pre>
391
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
392
<h3 class="title">Warning</h3>
393
<p><code class="literal">gtk_signal_new</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-new"><code class="function">g_signal_new()</code></a> instead.</p>
396
Creates a new signal type. (This is usually done in the
399
<div class="variablelist"><table border="0" class="variablelist">
401
<col align="left" valign="top">
406
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
407
<td>the event name for the signal, e.g. "clicked".</td>
410
<td><p><span class="term"><em class="parameter"><code>signal_flags</code></em> :</span></p></td>
411
<td>a combination of <span class="type">GTK_RUN</span> flags
412
specifying detail of when the default handler is to be invoked.
413
You should at least specify <span class="type">GTK_RUN_FIRST</span>
414
or <span class="type">GTK_RUN_LAST</span>.</td>
417
<td><p><span class="term"><em class="parameter"><code>object_type</code></em> :</span></p></td>
418
<td>the type of object this signal pertains to.
419
It will also pertain to derivers of this type automatically.</td>
422
<td><p><span class="term"><em class="parameter"><code>function_offset</code></em> :</span></p></td>
423
<td>How many bytes the function pointer is in
424
the class structure for this type. Used to invoke a class
425
method generically.</td>
428
<td><p><span class="term"><em class="parameter"><code>marshaller</code></em> :</span></p></td>
429
<td>the function to translate between an array
430
of GtkArgs and the native calling convention. Usually they
431
are identified just by the type of arguments they take:
432
for example, <code class="function">gtk_marshal_BOOL__STRING()</code> describes a marshaller
433
which takes a string and returns a boolean value.</td>
436
<td><p><span class="term"><em class="parameter"><code>return_val</code></em> :</span></p></td>
437
<td>the type of return value, or <span class="type">GTK_TYPE_NONE</span> for a signal
438
without a return value.</td>
441
<td><p><span class="term"><em class="parameter"><code>n_args</code></em> :</span></p></td>
442
<td>the number of parameter the handlers may take.</td>
445
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
446
<td>the signal id.</td>
452
<div class="refsect2">
453
<a name="gtk-signal-newv"></a><h3>gtk_signal_newv ()</h3>
454
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_signal_newv (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
455
<em class="parameter"><code><a class="link" href="gtk-Signals.html#GtkSignalRunType" title="enum GtkSignalRunType"><span class="type">GtkSignalRunType</span></a> signal_flags</code></em>,
456
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> object_type</code></em>,
457
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> function_offset</code></em>,
458
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#GSignalCMarshaller"><span class="type">GSignalCMarshaller</span></a> marshaller</code></em>,
459
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> return_val</code></em>,
460
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> n_args</code></em>,
461
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Type-Information.html#GType"><span class="type">GType</span></a> *args</code></em>);</pre>
462
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
463
<h3 class="title">Warning</h3>
464
<p><code class="literal">gtk_signal_newv</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-newv"><code class="function">g_signal_newv()</code></a> instead.</p>
467
Creates a new signal type. (This is usually done in a
471
This function take the types as an array, instead of a list
472
following the arguments. Otherwise the same as <a class="link" href="gtk-Signals.html#gtk-signal-new" title="gtk_signal_new ()"><code class="function">gtk_signal_new()</code></a>.
474
<div class="variablelist"><table border="0" class="variablelist">
476
<col align="left" valign="top">
481
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
482
<td>the name of the signal to create.</td>
485
<td><p><span class="term"><em class="parameter"><code>signal_flags</code></em> :</span></p></td>
486
<td>see <a class="link" href="gtk-Signals.html#gtk-signal-new" title="gtk_signal_new ()"><code class="function">gtk_signal_new()</code></a>.</td>
489
<td><p><span class="term"><em class="parameter"><code>object_type</code></em> :</span></p></td>
490
<td>the type of <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> to associate the signal with.</td>
493
<td><p><span class="term"><em class="parameter"><code>function_offset</code></em> :</span></p></td>
494
<td>how many bytes the function pointer is in
495
the class structure for this type.</td>
498
<td><p><span class="term"><em class="parameter"><code>return_val</code></em> :</span></p></td>
499
<td>the type of the return value, or <span class="type">GTK_TYPE_NONE</span> if
500
you don't want a return value.</td>
503
<td><p><span class="term"><em class="parameter"><code>n_args</code></em> :</span></p></td>
504
<td>the number of parameters to the user-defined handlers.</td>
507
<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
508
<td>an array of <a class="link" href="gtk-Types.html#GtkType" title="GtkType"><span class="type">GtkType</span></a>s, describing the prototype to
512
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
513
<td>the signal id.</td>
519
<div class="refsect2">
520
<a name="gtk-signal-lookup"></a><h3>gtk_signal_lookup()</h3>
521
<pre class="programlisting">#define gtk_signal_lookup(name,object_type)</pre>
522
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
523
<h3 class="title">Warning</h3>
524
<p><code class="literal">gtk_signal_lookup</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-lookup"><code class="function">g_signal_lookup()</code></a> instead.</p>
527
Given the name of the signal and the type of object it connects
528
to, get the signal's identifying integer. Emitting the signal
529
by number is somewhat faster than using the name each time.
532
It also tries the ancestors of the given type.
534
<div class="variablelist"><table border="0" class="variablelist">
536
<col align="left" valign="top">
541
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
542
<td>the signal's name, e.g. clicked.</td>
545
<td><p><span class="term"><em class="parameter"><code>object_type</code></em> :</span></p></td>
546
<td>the type that the signal operates on, e.g. <span class="type">GTK_TYPE_BUTTON</span>.</td>
549
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
550
<td>the signal's identifying number, or 0 if no signal was found.</td>
556
<div class="refsect2">
557
<a name="gtk-signal-name"></a><h3>gtk_signal_name()</h3>
558
<pre class="programlisting">#define gtk_signal_name(signal_id)</pre>
559
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
560
<h3 class="title">Warning</h3>
561
<p><code class="literal">gtk_signal_name</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-name"><code class="function">g_signal_name()</code></a> instead.</p>
564
Given the signal's identifier, finds its name.
567
Two different signals may have the same name, if they have differing types.
569
<div class="variablelist"><table border="0" class="variablelist">
571
<col align="left" valign="top">
576
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
577
<td>the signal's identifying number.</td>
580
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
581
<td>the signal name, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the signal number was invalid.</td>
587
<div class="refsect2">
588
<a name="gtk-signal-emit"></a><h3>gtk_signal_emit ()</h3>
589
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_emit (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
590
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signal_id</code></em>,
591
<em class="parameter"><code>...</code></em>);</pre>
592
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
593
<h3 class="title">Warning</h3>
594
<p><code class="literal">gtk_signal_emit</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-emit"><code class="function">g_signal_emit()</code></a> instead.</p>
597
Emits a signal. This causes the default handler and user-defined
601
Here is what <a class="link" href="gtk-Signals.html#gtk-signal-emit" title="gtk_signal_emit ()"><code class="function">gtk_signal_emit()</code></a> does:
604
1. Calls the default handler and the user-connected handlers.
605
The default handler will be called first if
606
<span class="type">GTK_RUN_FIRST</span> is set, and last if <span class="type">GTK_RUN_LAST</span> is set.
609
2. Calls all handlers connected with the "after" flag set.
611
<div class="variablelist"><table border="0" class="variablelist">
613
<col align="left" valign="top">
618
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
619
<td>the object that emits the signal.</td>
622
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
623
<td>the signal identifier.</td>
629
<div class="refsect2">
630
<a name="gtk-signal-emit-by-name"></a><h3>gtk_signal_emit_by_name ()</h3>
631
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_emit_by_name (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
632
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
633
<em class="parameter"><code>...</code></em>);</pre>
634
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
635
<h3 class="title">Warning</h3>
636
<p><code class="literal">gtk_signal_emit_by_name</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-emit-by-name"><code class="function">g_signal_emit_by_name()</code></a> instead.</p>
639
Emits a signal. This causes the default handler and user-connected
642
<div class="variablelist"><table border="0" class="variablelist">
644
<col align="left" valign="top">
649
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
650
<td>the object that emits the signal.</td>
653
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
654
<td>the name of the signal.</td>
660
<div class="refsect2">
661
<a name="gtk-signal-emitv"></a><h3>gtk_signal_emitv ()</h3>
662
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_emitv (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
663
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> signal_id</code></em>,
664
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkArg" title="struct GtkArg"><span class="type">GtkArg</span></a> *args</code></em>);</pre>
665
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
666
<h3 class="title">Warning</h3>
667
<p><code class="literal">gtk_signal_emitv</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-emitv"><code class="function">g_signal_emitv()</code></a> instead.</p>
670
Emits a signal. This causes the default handler and user-connected
671
handlers to be run. This differs from <a class="link" href="gtk-Signals.html#gtk-signal-emit" title="gtk_signal_emit ()"><code class="function">gtk_signal_emit()</code></a> by taking
672
an array of GtkArgs instead of using C's varargs mechanism.
674
<div class="variablelist"><table border="0" class="variablelist">
676
<col align="left" valign="top">
681
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
682
<td>the object to emit the signal to.</td>
685
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
686
<td>the signal identifier.</td>
689
<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
690
<td>an array of GtkArgs, one for each parameter,
691
followed by one which is a pointer to the return type.</td>
697
<div class="refsect2">
698
<a name="gtk-signal-emitv-by-name"></a><h3>gtk_signal_emitv_by_name ()</h3>
699
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_emitv_by_name (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
700
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
701
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkArg" title="struct GtkArg"><span class="type">GtkArg</span></a> *args</code></em>);</pre>
702
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
703
<h3 class="title">Warning</h3>
704
<p><code class="literal">gtk_signal_emitv_by_name</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-emitv"><code class="function">g_signal_emitv()</code></a> and <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-lookup"><code class="function">g_signal_lookup()</code></a> instead.</p>
707
Emits a signal by name. This causes the default handler and user-connected
708
handlers to be run. This differs from <a class="link" href="gtk-Signals.html#gtk-signal-emit" title="gtk_signal_emit ()"><code class="function">gtk_signal_emit()</code></a> by taking
709
an array of GtkArgs instead of using C's varargs mechanism.
711
<div class="variablelist"><table border="0" class="variablelist">
713
<col align="left" valign="top">
718
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
719
<td>the object to emit the signal to.</td>
722
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
723
<td>the name of the signal.</td>
726
<td><p><span class="term"><em class="parameter"><code>args</code></em> :</span></p></td>
727
<td>an array of GtkArgs, one for each parameter,
728
followed by one which is a pointer to the return type.</td>
734
<div class="refsect2">
735
<a name="gtk-signal-emit-stop"></a><h3>gtk_signal_emit_stop()</h3>
736
<pre class="programlisting">#define gtk_signal_emit_stop(object,signal_id)</pre>
737
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
738
<h3 class="title">Warning</h3>
739
<p><code class="literal">gtk_signal_emit_stop</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-stop-emission"><code class="function">g_signal_stop_emission()</code></a> instead.</p>
742
This function aborts a signal's current emission.
745
It will prevent the default method from running,
746
if the signal was <span class="type">GTK_RUN_LAST</span> and you connected
747
normally (i.e. without the "after" flag).
750
It will print a warning if used on a signal which
753
<div class="variablelist"><table border="0" class="variablelist">
755
<col align="left" valign="top">
760
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
761
<td>the object whose signal handlers you wish to stop.</td>
764
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
765
<td>the signal identifier, as returned by <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-lookup"><code class="function">g_signal_lookup()</code></a>.</td>
771
<div class="refsect2">
772
<a name="gtk-signal-emit-stop-by-name"></a><h3>gtk_signal_emit_stop_by_name ()</h3>
773
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_emit_stop_by_name (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
774
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>);</pre>
775
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
776
<h3 class="title">Warning</h3>
777
<p><code class="literal">gtk_signal_emit_stop_by_name</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-stop-emission-by-name"><code class="function">g_signal_stop_emission_by_name()</code></a> instead.</p>
780
This function aborts a signal's current emission.
783
It is just like <a class="link" href="gtk-Signals.html#gtk-signal-emit-stop" title="gtk_signal_emit_stop()"><code class="function">gtk_signal_emit_stop()</code></a>
784
except it will lookup the signal id for you.
786
<div class="variablelist"><table border="0" class="variablelist">
788
<col align="left" valign="top">
793
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
794
<td>the object whose signal handlers you wish to stop.</td>
797
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
798
<td>the name of the signal you wish to stop.</td>
804
<div class="refsect2">
805
<a name="gtk-signal-connect"></a><h3>gtk_signal_connect()</h3>
806
<pre class="programlisting">#define gtk_signal_connect(object,name,func,func_data)</pre>
807
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
808
<h3 class="title">Warning</h3>
809
<p><code class="literal">gtk_signal_connect</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a> instead.</p>
812
Attaches a function pointer and user data to a signal for
816
The <span class="type">GtkSignalFunction</span> takes a <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> as its first parameter.
817
It will be the same object as the one you're connecting
818
the hook to. The <em class="parameter"><code>func_data</code></em> will be passed as the last parameter
822
All else being equal, signal handlers are invoked in the order
823
connected (see <a class="link" href="gtk-Signals.html#gtk-signal-emit" title="gtk_signal_emit ()"><code class="function">gtk_signal_emit()</code></a> for the other details of
824
which order things are called in).
827
Here is how one passes an integer as user data,
828
for when you just want to specify a constant int
829
as parameter to your function:
831
<div class="informalexample">
832
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
835
<td class="listing_lines" align="right"><pre>1
847
<td class="listing_code"><pre class="programlisting"><span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">button_clicked_int</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">*</span><span class="normal"> button</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gpointer</span><span class="normal"> func_data</span><span class="symbol">)</span>
848
<span class="cbracket">{</span>
849
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Warnings-and-Assertions.html#g-print">g_print</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"button pressed: %d</span><span class="specialchar">\n</span><span class="string">"</span><span class="symbol">,</span><span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Type-Conversion-Macros.html#GPOINTER-TO-INT:CAPS">GPOINTER_TO_INT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">func_data</span><span class="symbol">));</span>
850
<span class="cbracket">}</span>
851
<span class="comment">/* By calling this function, you will make the g_print above</span>
852
<span class="comment"> * execute, printing the number passed as `to_print'. */</span>
853
<span class="keyword">static</span><span class="normal"> </span><span class="type">void</span><span class="normal"> </span><span class="function">attach_print_signal</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="GtkButton.html">GtkButton</a></span><span class="symbol">*</span><span class="normal"> button</span><span class="symbol">,</span><span class="normal"> </span><span class="usertype">gint</span><span class="normal"> to_print</span><span class="symbol">)</span>
854
<span class="cbracket">{</span>
855
<span class="normal"> </span><span class="function"><a href="gtk-Signals.html#gtk-signal-connect">gtk_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_OBJECT</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">button</span><span class="symbol">),</span><span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span>
856
<span class="normal"> </span><span class="function"><a href="gtk-Types.html#GTK-SIGNAL-FUNC:CAPS">GTK_SIGNAL_FUNC</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">button_clicked_int</span><span class="symbol">),</span>
857
<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Type-Conversion-Macros.html#GINT-TO-POINTER:CAPS">GINT_TO_POINTER</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">to_print</span><span class="symbol">));</span>
858
<span class="cbracket">}</span></pre></td>
864
<div class="variablelist"><table border="0" class="variablelist">
866
<col align="left" valign="top">
871
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
872
<td>the object associated with the signal, e.g. if a button
873
is getting pressed, this is that button.</td>
876
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
877
<td>name of the signal.</td>
880
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
881
<td>function pointer to attach to the signal.</td>
884
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
885
<td>value to pass as to your function (through the marshaller).</td>
888
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
889
<td>the connection id.</td>
895
<div class="refsect2">
896
<a name="gtk-signal-connect-after"></a><h3>gtk_signal_connect_after()</h3>
897
<pre class="programlisting">#define gtk_signal_connect_after(object,name,func,func_data)</pre>
898
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
899
<h3 class="title">Warning</h3>
900
<p><code class="literal">gtk_signal_connect_after</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-after"><code class="function">g_signal_connect_after()</code></a> instead.</p>
903
Attaches a function pointer and user data to a signal
904
so that this handler will be called after the other handlers.
906
<div class="variablelist"><table border="0" class="variablelist">
908
<col align="left" valign="top">
913
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
914
<td>the object associated with the signal.</td>
917
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
918
<td>name of the signal.</td>
921
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
922
<td>function pointer to attach to the signal.</td>
925
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
926
<td>value to pass as to your function (through the marshaller).</td>
929
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
930
<td>the unique identifier for this attachment: the connection id.</td>
936
<div class="refsect2">
937
<a name="gtk-signal-connect-object"></a><h3>gtk_signal_connect_object()</h3>
938
<pre class="programlisting">#define gtk_signal_connect_object(object,name,func,slot_object)</pre>
939
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
940
<h3 class="title">Warning</h3>
941
<p><code class="literal">gtk_signal_connect_object</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped"><code class="function">g_signal_connect_swapped()</code></a> instead.</p>
944
This function is for registering a callback that will
945
call another object's callback. That is,
946
instead of passing the object which is responsible
947
for the event as the first parameter of the callback,
948
it is switched with the user data (so the object which emits
949
the signal will be the last parameter, which is where the
950
user data usually is).
953
This is useful for passing a standard function in as a callback.
954
For example, if you wanted a button's press to <a class="link" href="GtkWidget.html#gtk-widget-show" title="gtk_widget_show ()"><code class="function">gtk_widget_show()</code></a>
955
some widget, you could write:
957
<div class="informalexample">
958
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
961
<td class="listing_lines" align="right"><pre>1</pre></td>
962
<td class="listing_code"><pre class="programlisting"><span class="function"><a href="gtk-Signals.html#gtk-signal-connect-object">gtk_signal_connect_object</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">button</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span><span class="normal"> <a href="GtkWidget.html#gtk-widget-show">gtk_widget_show</a></span><span class="symbol">,</span><span class="normal"> window</span><span class="symbol">);</span></pre></td>
968
<div class="variablelist"><table border="0" class="variablelist">
970
<col align="left" valign="top">
975
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
976
<td>the object which emits the signal.</td>
979
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
980
<td>the name of the signal.</td>
983
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
984
<td>the function to callback.</td>
987
<td><p><span class="term"><em class="parameter"><code>slot_object</code></em> :</span></p></td>
988
<td>the object to pass as the first parameter to func.
989
(Though it pretends to take an object, you can
990
really pass any gpointer as the <span class="type">slot_object</span> .)</td>
993
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
994
<td>the connection id.</td>
1000
<div class="refsect2">
1001
<a name="gtk-signal-connect-object-after"></a><h3>gtk_signal_connect_object_after()</h3>
1002
<pre class="programlisting">#define gtk_signal_connect_object_after(object,name,func,slot_object)</pre>
1003
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1004
<h3 class="title">Warning</h3>
1005
<p><code class="literal">gtk_signal_connect_object_after</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-data"><code class="function">g_signal_connect_data()</code></a> instead, passing
1006
<code class="literal">G_CONNECT_AFTER|G_CONNECT_SWAPPED</code> as <em class="parameter"><code>connect_flags</code></em>.</p>
1009
Attaches a signal hook to a signal, passing in an alternate
1010
object as the first parameter, and guaranteeing
1011
that the default handler and all normal
1012
handlers are called first.
1014
<div class="variablelist"><table border="0" class="variablelist">
1016
<col align="left" valign="top">
1021
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1022
<td>the object associated with the signal.</td>
1025
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1026
<td>name of the signal.</td>
1029
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1030
<td>function pointer to attach to the signal.</td>
1033
<td><p><span class="term"><em class="parameter"><code>slot_object</code></em> :</span></p></td>
1034
<td>the object to pass as the first parameter to <span class="type">func</span>.</td>
1037
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1038
<td>the connection id.</td>
1044
<div class="refsect2">
1045
<a name="gtk-signal-connect-full"></a><h3>gtk_signal_connect_full ()</h3>
1046
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gulong"><span class="returnvalue">gulong</span></a> gtk_signal_connect_full (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
1047
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
1048
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
1049
<em class="parameter"><code><a class="link" href="gtk-Types.html#GtkCallbackMarshal" title="GtkCallbackMarshal ()"><span class="type">GtkCallbackMarshal</span></a> unsupported</code></em>,
1050
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> data</code></em>,
1051
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Datasets.html#GDestroyNotify"><span class="type">GDestroyNotify</span></a> destroy_func</code></em>,
1052
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> object_signal</code></em>,
1053
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> after</code></em>);</pre>
1054
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1055
<h3 class="title">Warning</h3>
1056
<p><code class="literal">gtk_signal_connect_full</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-data"><code class="function">g_signal_connect_data()</code></a> instead.</p>
1059
Attaches a function pointer and user data to a signal with
1062
<div class="variablelist"><table border="0" class="variablelist">
1064
<col align="left" valign="top">
1069
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1070
<td>the object which emits the signal. For example, a button
1071
in the button press signal.</td>
1074
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1075
<td>the name of the signal.</td>
1078
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1079
<td>function pointer to attach to the signal.</td>
1082
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1083
<td>the user data associated with the function.</td>
1086
<td><p><span class="term"><em class="parameter"><code>destroy_func</code></em> :</span></p></td>
1087
<td>function to call when this particular hook is
1091
<td><p><span class="term"><em class="parameter"><code>object_signal</code></em> :</span></p></td>
1092
<td>whether this is an object signal-- basically an "object
1093
signal" is one that wants its user_data and object fields switched,
1094
which is useful for calling functions which operate on another
1095
object primarily.</td>
1098
<td><p><span class="term"><em class="parameter"><code>after</code></em> :</span></p></td>
1099
<td>whether to invoke the user-defined handler after the signal, or to let
1100
the signal's default behavior preside (i.e. depending on <span class="type">GTK_RUN_FIRST</span>
1101
and <span class="type">GTK_RUN_LAST</span>).</td>
1104
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1105
<td>the connection id.</td>
1111
<div class="refsect2">
1112
<a name="gtk-signal-connect-while-alive"></a><h3>gtk_signal_connect_while_alive ()</h3>
1113
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_connect_while_alive (<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
1114
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
1115
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
1116
<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>,
1117
<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *alive_object</code></em>);</pre>
1118
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1119
<h3 class="title">Warning</h3>
1120
<p><code class="literal">gtk_signal_connect_while_alive</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a> instead.</p>
1123
Attaches a function pointer and another <a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> to a signal.
1126
This function takes an object whose "destroy" signal
1128
That way, you don't have to clean up the
1129
signal handler when you destroy the object.
1130
It is a little less efficient though.
1133
(Instead you may call <a class="link" href="gtk-Signals.html#gtk-signal-disconnect-by-data" title="gtk_signal_disconnect_by_data()"><code class="function">gtk_signal_disconnect_by_data()</code></a>, if you want
1134
to explicitly delete all attachments to this object. This
1135
is perhaps not recommended since it could be confused
1136
with an integer masquerading as a pointer (through <a href="http://library.gnome.org/devel/glib/unstable/glib-Type-Conversion-Macros.html#GINT-TO-POINTER:CAPS"><code class="function">GINT_TO_POINTER()</code></a>).)
1138
<div class="variablelist"><table border="0" class="variablelist">
1140
<col align="left" valign="top">
1145
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1146
<td>the object that emits the signal.</td>
1149
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1150
<td>name of the signal.</td>
1153
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1154
<td>function pointer to attach to the signal.</td>
1157
<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td>
1158
<td>pointer to pass to func.</td>
1161
<td><p><span class="term"><em class="parameter"><code>alive_object</code></em> :</span></p></td>
1162
<td>object whose death should cause the handler connection
1163
to be destroyed.</td>
1169
<div class="refsect2">
1170
<a name="gtk-signal-connect-object-while-alive"></a><h3>gtk_signal_connect_object_while_alive ()</h3>
1171
<pre class="programlisting"><span class="returnvalue">void</span> gtk_signal_connect_object_while_alive
1172
(<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *object</code></em>,
1173
<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *name</code></em>,
1174
<em class="parameter"><code><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#GCallback"><span class="type">GCallback</span></a> func</code></em>,
1175
<em class="parameter"><code><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a> *alive_object</code></em>);</pre>
1176
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1177
<h3 class="title">Warning</h3>
1178
<p><code class="literal">gtk_signal_connect_object_while_alive</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-object"><code class="function">g_signal_connect_object()</code></a> instead, passing
1179
<code class="literal">G_CONNECT_SWAPPED</code> as <em class="parameter"><code>connect_flags</code></em>.</p>
1182
These signal connectors are for signals which refer to objects,
1183
so they must not be called after the object is deleted.
1186
Unlike <a class="link" href="gtk-Signals.html#gtk-signal-connect-while-alive" title="gtk_signal_connect_while_alive ()"><code class="function">gtk_signal_connect_while_alive()</code></a>,
1187
this swaps the object and user data, making it suitable for
1188
use with functions which primarily operate on the user data.
1191
This function acts just like <a class="link" href="gtk-Signals.html#gtk-signal-connect-object" title="gtk_signal_connect_object()"><code class="function">gtk_signal_connect_object()</code></a> except
1192
it traps the "destroy" signal to prevent you from having to
1193
clean up the handler.
1195
<div class="variablelist"><table border="0" class="variablelist">
1197
<col align="left" valign="top">
1202
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1203
<td>the object associated with the signal.</td>
1206
<td><p><span class="term"><em class="parameter"><code>name</code></em> :</span></p></td>
1207
<td>name of the signal.</td>
1210
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1211
<td>function pointer to attach to the signal.</td>
1214
<td><p><span class="term"><em class="parameter"><code>alive_object</code></em> :</span></p></td>
1215
<td>the user data, which must be an object, whose destruction
1216
should signal the removal of this signal.</td>
1222
<div class="refsect2">
1223
<a name="gtk-signal-disconnect"></a><h3>gtk_signal_disconnect()</h3>
1224
<pre class="programlisting">#define gtk_signal_disconnect(object,handler_id)</pre>
1225
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1226
<h3 class="title">Warning</h3>
1227
<p><code class="literal">gtk_signal_disconnect</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handler-disconnect"><code class="function">g_signal_handler_disconnect()</code></a> instead.</p>
1230
Destroys a user-defined handler connection.
1232
<div class="variablelist"><table border="0" class="variablelist">
1234
<col align="left" valign="top">
1239
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1240
<td>the object which the handler pertains to.</td>
1243
<td><p><span class="term"><em class="parameter"><code>handler_id</code></em> :</span></p></td>
1244
<td>the connection id.</td>
1250
<div class="refsect2">
1251
<a name="gtk-signal-disconnect-by-func"></a><h3>gtk_signal_disconnect_by_func()</h3>
1252
<pre class="programlisting">#define gtk_signal_disconnect_by_func(object,func,data)</pre>
1253
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1254
<h3 class="title">Warning</h3>
1255
<p><code class="literal">gtk_signal_disconnect_by_func</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-disconnect-by-func"><code class="function">g_signal_handlers_disconnect_by_func()</code></a> instead.</p>
1258
Destroys all connections for a particular object, with
1259
the given function-pointer and user-data.
1261
<div class="variablelist"><table border="0" class="variablelist">
1263
<col align="left" valign="top">
1268
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1269
<td>the object which emits the signal.</td>
1272
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1273
<td>the function pointer to search for.</td>
1276
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1277
<td>the user data to search for.</td>
1283
<div class="refsect2">
1284
<a name="gtk-signal-disconnect-by-data"></a><h3>gtk_signal_disconnect_by_data()</h3>
1285
<pre class="programlisting">#define gtk_signal_disconnect_by_data(object,data)</pre>
1286
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1287
<h3 class="title">Warning</h3>
1288
<p><code class="literal">gtk_signal_disconnect_by_data</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-disconnect-matched"><code class="function">g_signal_handlers_disconnect_matched()</code></a> instead.</p>
1291
Destroys all connections for a particular object, with
1292
the given user-data.
1294
<div class="variablelist"><table border="0" class="variablelist">
1296
<col align="left" valign="top">
1301
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1302
<td>the object which emits the signal.</td>
1305
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1306
<td>the user data to search for.</td>
1312
<div class="refsect2">
1313
<a name="gtk-signal-handler-block"></a><h3>gtk_signal_handler_block()</h3>
1314
<pre class="programlisting">#define gtk_signal_handler_block(object,handler_id)</pre>
1315
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1316
<h3 class="title">Warning</h3>
1317
<p><code class="literal">gtk_signal_handler_block</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handler-block"><code class="function">g_signal_handler_block()</code></a> instead.</p>
1320
Prevents a user-defined handler from being invoked. All other
1321
signal processing will go on as normal, but this particular
1322
handler will ignore it.
1324
<div class="variablelist"><table border="0" class="variablelist">
1326
<col align="left" valign="top">
1331
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1332
<td>the object which emits the signal to block.</td>
1335
<td><p><span class="term"><em class="parameter"><code>handler_id</code></em> :</span></p></td>
1336
<td>the connection id.</td>
1342
<div class="refsect2">
1343
<a name="gtk-signal-handler-block-by-func"></a><h3>gtk_signal_handler_block_by_func()</h3>
1344
<pre class="programlisting">#define gtk_signal_handler_block_by_func(object,func,data)</pre>
1345
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1346
<h3 class="title">Warning</h3>
1347
<p><code class="literal">gtk_signal_handler_block_by_func</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-block-by-func"><code class="function">g_signal_handlers_block_by_func()</code></a> instead.</p>
1350
Prevents a user-defined handler from being invoked, by reference to
1351
the user-defined handler's function pointer and user data. (It may result in
1352
multiple hooks being blocked, if you've called connect multiple times.)
1354
<div class="variablelist"><table border="0" class="variablelist">
1356
<col align="left" valign="top">
1361
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1362
<td>the object which emits the signal to block.</td>
1365
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1366
<td>the function pointer of the handler to block.</td>
1369
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1370
<td>the user data of the handler to block.</td>
1376
<div class="refsect2">
1377
<a name="gtk-signal-handler-block-by-data"></a><h3>gtk_signal_handler_block_by_data()</h3>
1378
<pre class="programlisting">#define gtk_signal_handler_block_by_data(object,data)</pre>
1379
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1380
<h3 class="title">Warning</h3>
1381
<p><code class="literal">gtk_signal_handler_block_by_data</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-block-matched"><code class="function">g_signal_handlers_block_matched()</code></a> instead.</p>
1384
Prevents all user-defined handlers with a certain user data from being invoked.
1386
<div class="variablelist"><table border="0" class="variablelist">
1388
<col align="left" valign="top">
1393
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1394
<td>the object which emits the signal we want to block.</td>
1397
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1398
<td>the user data of the handlers to block.</td>
1404
<div class="refsect2">
1405
<a name="gtk-signal-handler-unblock"></a><h3>gtk_signal_handler_unblock()</h3>
1406
<pre class="programlisting">#define gtk_signal_handler_unblock(object,handler_id)</pre>
1407
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1408
<h3 class="title">Warning</h3>
1409
<p><code class="literal">gtk_signal_handler_unblock</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handler-unblock"><code class="function">g_signal_handler_unblock()</code></a> instead.</p>
1412
Undoes a block, by connection id. Note that undoing a block doesn't
1413
necessarily make the hook callable, because if you block a
1414
hook twice, you must unblock it twice.
1416
<div class="variablelist"><table border="0" class="variablelist">
1418
<col align="left" valign="top">
1423
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1424
<td>the object which emits the signal we want to unblock.</td>
1427
<td><p><span class="term"><em class="parameter"><code>handler_id</code></em> :</span></p></td>
1428
<td>the emission handler identifier, as returned by
1429
<a class="link" href="gtk-Signals.html#gtk-signal-connect" title="gtk_signal_connect()"><code class="function">gtk_signal_connect()</code></a>, etc.</td>
1435
<div class="refsect2">
1436
<a name="gtk-signal-handler-unblock-by-func"></a><h3>gtk_signal_handler_unblock_by_func()</h3>
1437
<pre class="programlisting">#define gtk_signal_handler_unblock_by_func(object,func,data)</pre>
1438
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1439
<h3 class="title">Warning</h3>
1440
<p><code class="literal">gtk_signal_handler_unblock_by_func</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-unblock-by-func"><code class="function">g_signal_handlers_unblock_by_func()</code></a> instead.</p>
1443
Undoes a block, by function pointer and data.
1444
Note that undoing a block doesn't
1445
necessarily make the hook callable, because if you block a
1446
hook twice, you must unblock it twice.
1448
<div class="variablelist"><table border="0" class="variablelist">
1450
<col align="left" valign="top">
1455
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1456
<td>the object which emits the signal we want to unblock.</td>
1459
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1460
<td>the function pointer to search for.</td>
1463
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1464
<td>the user data to search for.</td>
1470
<div class="refsect2">
1471
<a name="gtk-signal-handler-unblock-by-data"></a><h3>gtk_signal_handler_unblock_by_data()</h3>
1472
<pre class="programlisting">#define gtk_signal_handler_unblock_by_data(object,data)</pre>
1473
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1474
<h3 class="title">Warning</h3>
1475
<p><code class="literal">gtk_signal_handler_unblock_by_data</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-handlers-unblock-matched"><code class="function">g_signal_handlers_unblock_matched()</code></a> instead.</p>
1478
Undoes block(s), to all signals for a particular object
1479
with a particular user-data pointer
1481
<div class="variablelist"><table border="0" class="variablelist">
1483
<col align="left" valign="top">
1488
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1489
<td>the object which emits the signal we want to unblock.</td>
1492
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1493
<td>the user data to search for.</td>
1499
<div class="refsect2">
1500
<a name="gtk-signal-handler-pending"></a><h3>gtk_signal_handler_pending()</h3>
1501
<pre class="programlisting">#define gtk_signal_handler_pending(object,signal_id,may_be_blocked)</pre>
1502
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1503
<h3 class="title">Warning</h3>
1504
<p><code class="literal">gtk_signal_handler_pending</code> is deprecated and should not be used in newly-written code. Use <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-has-handler-pending"><code class="function">g_signal_has_handler_pending()</code></a> instead.</p>
1507
Returns a connection id corresponding to a given signal id and object.
1510
One example of when you might use this is when the arguments
1511
to the signal are difficult to compute. A class implementor
1512
may opt to not emit the signal if no one is attached anyway,
1513
thus saving the cost of building the arguments.
1515
<div class="variablelist"><table border="0" class="variablelist">
1517
<col align="left" valign="top">
1522
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1523
<td>the object to search for the desired user-defined handler.</td>
1526
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
1527
<td>the number of the signal to search for.</td>
1530
<td><p><span class="term"><em class="parameter"><code>may_be_blocked</code></em> :</span></p></td>
1531
<td>whether it is acceptable to return a blocked
1535
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1536
<td>the connection id, if a connection was found. 0 otherwise.</td>
1542
<div class="refsect2">
1543
<a name="gtk-signal-handler-pending-by-func"></a><h3>gtk_signal_handler_pending_by_func()</h3>
1544
<pre class="programlisting">#define gtk_signal_handler_pending_by_func(object,signal_id,may_be_blocked,func,data)</pre>
1545
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1546
<h3 class="title">Warning</h3>
1547
<p><code class="literal">gtk_signal_handler_pending_by_func</code> is deprecated and should not be used in newly-written code.</p>
1550
Returns a connection id corresponding to a given signal id, object, function
1551
pointer and user data.
1553
<div class="variablelist"><table border="0" class="variablelist">
1555
<col align="left" valign="top">
1560
<td><p><span class="term"><em class="parameter"><code>object</code></em> :</span></p></td>
1561
<td>the object to search for the desired handler.</td>
1564
<td><p><span class="term"><em class="parameter"><code>signal_id</code></em> :</span></p></td>
1565
<td>the number of the signal to search for.</td>
1568
<td><p><span class="term"><em class="parameter"><code>may_be_blocked</code></em> :</span></p></td>
1569
<td>whether it is acceptable to return a blocked
1573
<td><p><span class="term"><em class="parameter"><code>func</code></em> :</span></p></td>
1574
<td>the function pointer to search for.</td>
1577
<td><p><span class="term"><em class="parameter"><code>data</code></em> :</span></p></td>
1578
<td>the user data to search for.</td>
1581
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
1582
<td>the connection id, if a handler was found. 0 otherwise.</td>
1588
<div class="refsect2">
1589
<a name="gtk-signal-default-marshaller"></a><h3>gtk_signal_default_marshaller</h3>
1590
<pre class="programlisting">#define gtk_signal_default_marshaller g_cclosure_marshal_VOID__VOID
1592
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
1593
<h3 class="title">Warning</h3>
1594
<p><code class="literal">gtk_signal_default_marshaller</code> is deprecated and should not be used in newly-written code.</p>
1597
A marshaller that returns void and takes no extra parameters.
1601
<div class="refsect1">
1602
<a name="gtk-Signals.see-also"></a><h2>See Also</h2>
1605
<div class="variablelist"><table border="0" class="variablelist">
1607
<col align="left" valign="top">
1612
<td><p><span class="term"><a class="link" href="GtkObject.html" title="GtkObject"><span class="type">GtkObject</span></a></span></p></td>
1613
<td><p>The base class for things which emit signals.</p></td>
1616
<td><p><span class="term"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html">GSignal</a></span></p></td>
1617
<td><p>The GLib signal system.</p></td>
1625
<div class="footer">
1627
Generated by GTK-Doc V1.18.1</div>
b'\\ No newline at end of file'