~canonical-dx-team/ubuntu/maverick/gtk+2.0/menuproxy

« back to all changes in this revision

Viewing changes to docs/reference/gtk/html/gtk-General.html

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2007-05-04 12:24:25 UTC
  • mfrom: (1.1.21 upstream)
  • Revision ID: james.westby@ubuntu.com-20070504122425-0m8midgzrp40y8w2
Tags: 2.10.12-1ubuntu1
* Sync with Debian
* New upstream version:
  Fixed bugs:
  - 379414 file chooser warnings when changing path in the entry
  - 418585 GtkFileChooserDefault sizing code is not DPI independent
  - 419568 Crash in search if start with special letter
  - 435062 build dies with icon cache validation
  - 379399 Segfault to call gtk_print_operation_run twice.
  - 387889 cups backend has problems when there are too many printers
  - 418531 invalid read to gtkicontheme.c gtk_icon_theme_lookup_icon...
  - 423916 crash in color scheme code
  - 424042 Segmentation fault while quickly pressing Alt+arrows
  - 415260 Protect against negative indices when setting values in G...
  - 419171 XGetVisualInfo() may not set nxvisuals
  - 128852 Gdk cursors don't look good on win32
  - 344657 Ctrl-H doesn't toggle "Show Hidden Files" setting
  - 345345 PrintOperation::paginate is not emitted for class handler
  - 347567 GtkPrintOperation::end-print is not emitted if it's cance...
  - 369112 gtk_ui_manager_add_ui should accept unnamed separator
  - 392015 Selected menu item invisible on Windows Vista
  - 399253 MS-Windows Theme Bottom Tab placement rendering glitches
  - 399425 gtk_input_dialog_fill_axes() adds child to gtkscrolledwin...
  - 403251 [patch] little memory leak in GtkPrintJob
  - 403267 [patch] memory leak in GtkPageSetupUnixDialog
  - 403470 MS-Windows Theme tab placement other than on top leaks a ...
  - 404506 Windows system fonts that have multi-byte font names cann...
  - 405089 Incorrect window placement for GtkEventBox private window
  - 405515 Minor leak in gtkfilesystemmodel.c
  - 405539 gdk_pixbuf_save() for PNG saver can return FALSE without ...
  - 415681 gdk_window_clear_area includes an extra line and column o...
  - 418219 GtkRecentChooser should apply filter before sorting and c...
  - 418403 Scroll to printer after selecting it from settings
  - 421985 _gtk_print_operation_platform_backend_launch_preview
  - 421990 gtk_print_job_get_surface
  - 421993 gtk_print_operation_init
  - 423064 Conditional jump or move depends on uninitialised value(s...
  - 423722 Fix printing header in gtk-demo
  - 424168 gtk_print_operation_run on async preview
  - 425655 Don't install gtk+-unix-print-2.0.pc on non-UNIX platforms
  - 425786 GDK segfaults if XineramaQueryScreens fails
  - 428665 Lpr Backend gets stuck in infinite loop during gtk_enumer...
  - 429902 GtkPrintOperation leaks cairo contextes
  - 431997 First delay of GdkPixbufAnimationIter is wrong
  - 433242 Inconsistent scroll arrow position calculations
  - 433972 Placing gtk.Expander inside a gtk.TextView() changes gtk....
  - 434261 _gtk_toolbar_elide_underscores incorrectly handles some s...
  - 383354 ctrl-L should make 'Location' entry disappear
  - 418673 gtk_recent_manager_add_item
  - 429732 gtk_accel_group_finalize accesses invalid memory
  - 435028 WM_CLIENT_LEADER is wrong on the leader_window
  - 431067 Background of the header window is not updated
  - 338843 add recent files support inside the ui manager
  - 148535 add drop shadow to menus, tooltips, etc. under Windows XP
* debian/control.in:
  - Conflicts on ubuntulooks (<= 0.9.11-1)
* debian/patches/15_default-fallback-icon-theme.patch:
  - patch from Debian, fallback on gnome icon theme

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
 
2
<html>
 
3
<head>
 
4
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
 
5
<title>Main loop and Events</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="gtkbase.html" title="Part&#160;II.&#160;GTK+ Core Reference">
 
9
<link rel="prev" href="gtkbase.html" title="Part&#160;II.&#160;GTK+ Core Reference">
 
10
<link rel="next" href="gtk-Keyboard-Accelerators.html" title="Accelerator Groups">
 
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&#160;I.&#160;GTK+ Overview">
 
14
<link rel="part" href="gtkbase.html" title="Part&#160;II.&#160;GTK+ Core Reference">
 
15
<link rel="part" href="gtkobjects.html" title="Part&#160;III.&#160;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&#160;IV.&#160;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&#160;V.&#160;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">
 
57
</head>
 
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">
 
60
<tr valign="middle">
 
61
<td><a accesskey="p" href="gtkbase.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
 
62
<td><a accesskey="u" href="gtkbase.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="gtk-Keyboard-Accelerators.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
 
66
</tr>
 
67
<tr><td colspan="5" class="shortcuts"><nobr><a href="#id2630618" class="shortcut">Top</a>
 
68
                  &#160;|&#160;
 
69
                  <a href="#id2631993" class="shortcut">Description</a></nobr></td></tr>
 
70
</table>
 
71
<div class="refentry" lang="en">
 
72
<a name="gtk-General"></a><div class="titlepage"></div>
 
73
<div class="refnamediv"><table width="100%"><tr>
 
74
<td valign="top">
 
75
<h2>
 
76
<a name="id2630618"></a><span class="refentrytitle">Main loop and Events</span>
 
77
</h2>
 
78
<p>Main loop and Events &#8212; Library initialization, main event loop, and events</p>
 
79
</td>
 
80
<td valign="top" align="right"></td>
 
81
</tr></table></div>
 
82
<div class="refsynopsisdiv">
 
83
<h2>Synopsis</h2>
 
84
<pre class="synopsis">
 
85
 
 
86
#include &lt;gtk/gtk.h&gt;
 
87
 
 
88
 
 
89
gchar*              <a href="gtk-General.html#gtk-set-locale">gtk_set_locale</a>                      (void);
 
90
void                <a href="gtk-General.html#gtk-disable-setlocale">gtk_disable_setlocale</a>               (void);
 
91
PangoLanguage*      <a href="gtk-General.html#gtk-get-default-language">gtk_get_default_language</a>            (void);
 
92
gboolean            <a href="gtk-General.html#gtk-parse-args">gtk_parse_args</a>                      (int *argc,
 
93
                                                         char ***argv);
 
94
void                <a href="gtk-General.html#gtk-init">gtk_init</a>                            (int *argc,
 
95
                                                         char ***argv);
 
96
gboolean            <a href="gtk-General.html#gtk-init-check">gtk_init_check</a>                      (int *argc,
 
97
                                                         char ***argv);
 
98
gboolean            <a href="gtk-General.html#gtk-init-with-args">gtk_init_with_args</a>                  (int *argc,
 
99
                                                         char ***argv,
 
100
                                                         char *parameter_string,
 
101
                                                         GOptionEntry *entries,
 
102
                                                         char *translation_domain,
 
103
                                                         GError **error);
 
104
GOptionGroup*       <a href="gtk-General.html#gtk-get-option-group">gtk_get_option_group</a>                (gboolean open_default_display);
 
105
void                <a href="gtk-General.html#gtk-exit">gtk_exit</a>                            (gint error_code);
 
106
gboolean            <a href="gtk-General.html#gtk-events-pending">gtk_events_pending</a>                  (void);
 
107
void                <a href="gtk-General.html#gtk-main">gtk_main</a>                            (void);
 
108
guint               <a href="gtk-General.html#gtk-main-level">gtk_main_level</a>                      (void);
 
109
void                <a href="gtk-General.html#gtk-main-quit">gtk_main_quit</a>                       (void);
 
110
gboolean            <a href="gtk-General.html#gtk-main-iteration">gtk_main_iteration</a>                  (void);
 
111
gboolean            <a href="gtk-General.html#gtk-main-iteration-do">gtk_main_iteration_do</a>               (gboolean blocking);
 
112
void                <a href="gtk-General.html#gtk-main-do-event">gtk_main_do_event</a>                   (<a
 
113
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
114
>GdkEvent</a> *event);
 
115
void                (<a href="gtk-General.html#GtkModuleInitFunc">*GtkModuleInitFunc</a>)                (gint *argc,
 
116
                                                         gchar ***argv);
 
117
void                (<a href="gtk-General.html#GtkModuleDisplayInitFunc">*GtkModuleDisplayInitFunc</a>)         (<a
 
118
href="../gdk/GdkDisplay.html"
 
119
>GdkDisplay</a> *display);
 
120
 
 
121
gboolean            <a href="gtk-General.html#gtk-true">gtk_true</a>                            (void);
 
122
gboolean            <a href="gtk-General.html#gtk-false">gtk_false</a>                           (void);
 
123
 
 
124
void                <a href="gtk-General.html#gtk-grab-add">gtk_grab_add</a>                        (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);
 
125
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          <a href="gtk-General.html#gtk-grab-get-current">gtk_grab_get_current</a>                (void);
 
126
void                <a href="gtk-General.html#gtk-grab-remove">gtk_grab_remove</a>                     (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);
 
127
 
 
128
void                <a href="gtk-General.html#gtk-init-add">gtk_init_add</a>                        (<a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
129
                                                         gpointer data);
 
130
void                <a href="gtk-General.html#gtk-quit-add-destroy">gtk_quit_add_destroy</a>                (guint main_level,
 
131
                                                         <a href="GtkObject.html" title="GtkObject">GtkObject</a> *object);
 
132
guint               <a href="gtk-General.html#gtk-quit-add">gtk_quit_add</a>                        (guint main_level,
 
133
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
134
                                                         gpointer data);
 
135
guint               <a href="gtk-General.html#gtk-quit-add-full">gtk_quit_add_full</a>                   (guint main_level,
 
136
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
137
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
138
                                                         gpointer data,
 
139
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);
 
140
void                <a href="gtk-General.html#gtk-quit-remove">gtk_quit_remove</a>                     (guint quit_handler_id);
 
141
void                <a href="gtk-General.html#gtk-quit-remove-by-data">gtk_quit_remove_by_data</a>             (gpointer data);
 
142
 
 
143
guint               <a href="gtk-General.html#gtk-timeout-add-full">gtk_timeout_add_full</a>                (guint32 interval,
 
144
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
145
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
146
                                                         gpointer data,
 
147
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);
 
148
guint               <a href="gtk-General.html#gtk-timeout-add">gtk_timeout_add</a>                     (guint32 interval,
 
149
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
150
                                                         gpointer data);
 
151
void                <a href="gtk-General.html#gtk-timeout-remove">gtk_timeout_remove</a>                  (guint timeout_handler_id);
 
152
 
 
153
guint               <a href="gtk-General.html#gtk-idle-add">gtk_idle_add</a>                        (<a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
154
                                                         gpointer data);
 
155
guint               <a href="gtk-General.html#gtk-idle-add-priority">gtk_idle_add_priority</a>               (gint priority,
 
156
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
157
                                                         gpointer data);
 
158
guint               <a href="gtk-General.html#gtk-idle-add-full">gtk_idle_add_full</a>                   (gint priority,
 
159
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
160
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
161
                                                         gpointer data,
 
162
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);
 
163
void                <a href="gtk-General.html#gtk-idle-remove">gtk_idle_remove</a>                     (guint idle_handler_id);
 
164
void                <a href="gtk-General.html#gtk-idle-remove-by-data">gtk_idle_remove_by_data</a>             (gpointer data);
 
165
 
 
166
guint               <a href="gtk-General.html#gtk-input-add-full">gtk_input_add_full</a>                  (gint source,
 
167
                                                         <a
 
168
href="../gdk/gdk-Input.html#GdkInputCondition"
 
169
>GdkInputCondition</a> condition,
 
170
                                                         <a
 
171
href="../gdk/gdk-Input.html#GdkInputFunction"
 
172
>GdkInputFunction</a> function,
 
173
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
174
                                                         gpointer data,
 
175
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);
 
176
void                <a href="gtk-General.html#gtk-input-remove">gtk_input_remove</a>                    (guint input_handler_id);
 
177
 
 
178
#define             <a href="gtk-General.html#GTK-PRIORITY-REDRAW:CAPS">GTK_PRIORITY_REDRAW</a>
 
179
#define             <a href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS">GTK_PRIORITY_RESIZE</a>
 
180
#define             <a href="gtk-General.html#GTK-PRIORITY-HIGH:CAPS">GTK_PRIORITY_HIGH</a>
 
181
#define             <a href="gtk-General.html#GTK-PRIORITY-INTERNAL:CAPS">GTK_PRIORITY_INTERNAL</a>
 
182
#define             <a href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS">GTK_PRIORITY_DEFAULT</a>
 
183
#define             <a href="gtk-General.html#GTK-PRIORITY-LOW:CAPS">GTK_PRIORITY_LOW</a>
 
184
 
 
185
guint               <a href="gtk-General.html#gtk-key-snooper-install">gtk_key_snooper_install</a>             (<a href="gtk-General.html#GtkKeySnoopFunc">GtkKeySnoopFunc</a> snooper,
 
186
                                                         gpointer func_data);
 
187
gint                (<a href="gtk-General.html#GtkKeySnoopFunc">*GtkKeySnoopFunc</a>)                  (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *grab_widget,
 
188
                                                         <a
 
189
href="../gdk/gdk-Event-Structures.html#GdkEventKey"
 
190
>GdkEventKey</a> *event,
 
191
                                                         gpointer func_data);
 
192
void                <a href="gtk-General.html#gtk-key-snooper-remove">gtk_key_snooper_remove</a>              (guint snooper_handler_id);
 
193
 
 
194
<a
 
195
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
196
>GdkEvent</a>*           <a href="gtk-General.html#gtk-get-current-event">gtk_get_current_event</a>               (void);
 
197
guint32             <a href="gtk-General.html#gtk-get-current-event-time">gtk_get_current_event_time</a>          (void);
 
198
gboolean            <a href="gtk-General.html#gtk-get-current-event-state">gtk_get_current_event_state</a>         (<a
 
199
href="../gdk/gdk-Windows.html#GdkModifierType"
 
200
>GdkModifierType</a> *state);
 
201
<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          <a href="gtk-General.html#gtk-get-event-widget">gtk_get_event_widget</a>                (<a
 
202
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
203
>GdkEvent</a> *event);
 
204
void                <a href="gtk-General.html#gtk-propagate-event">gtk_propagate_event</a>                 (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget,
 
205
                                                         <a
 
206
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
207
>GdkEvent</a> *event);
 
208
 
 
209
</pre>
 
210
</div>
 
211
<div class="refsect1" lang="en">
 
212
<a name="id2631993"></a><h2>Description</h2>
 
213
<p>
 
214
Before using GTK+, you need to initialize it; initialization connects
 
215
to the window system display, and parses some standard command line
 
216
arguments. The <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a> function initializes GTK+. <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a> exits
 
217
the application if errors occur; to avoid this, use <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a>. 
 
218
<a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a> allows you to recover from a failed GTK+
 
219
initialization - you might start up your application in text mode instead.
 
220
</p>
 
221
<p>
 
222
Like all GUI toolkits, GTK+ uses an event-driven programming
 
223
model. When the user is doing nothing, GTK+ sits in the
 
224
<em class="firstterm">main loop</em> and waits for input. If the user
 
225
performs some action - say, a mouse click - then the main loop "wakes
 
226
up" and delivers an event to GTK+. GTK+ forwards the event to one or
 
227
more widgets.
 
228
</p>
 
229
<p>
 
230
When widgets receive an event, they frequently emit one or more 
 
231
<em class="firstterm">signals</em>. Signals notify your program that
 
232
"something interesting happened" by invoking functions you've
 
233
connected to the signal with <code class="function">g_signal_connect()</code>. Functions connected
 
234
to a signal are often termed <em class="firstterm">callbacks</em>. 
 
235
</p>
 
236
<p>
 
237
When your callbacks are invoked, you would typically take some action
 
238
- for example, when an Open button is clicked you might display a 
 
239
<span class="type">GtkFileSelectionDialog</span>. After a callback finishes, GTK+ will return
 
240
to the main loop and await more user input.
 
241
</p>
 
242
<div class="example">
 
243
<a name="id2632109"></a><p class="title"><b>Example&#160;1.&#160;Typical <code class="function">main</code> function for a GTK+ application</b></p>
 
244
<div class="example-contents"><pre class="programlisting">
 
245
int 
 
246
main (int argc, char **argv)
 
247
{
 
248
  /* Initialize i18n support */
 
249
  gtk_set_locale ();
 
250
 
 
251
  /* Initialize the widget set */
 
252
  gtk_init (&amp;argc, &amp;argv);
 
253
 
 
254
  /* Create the main window */
 
255
  mainwin = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
256
 
 
257
  /* Set up our GUI elements */
 
258
  ...
 
259
 
 
260
  /* Show the application window */
 
261
  gtk_widget_show_all (mainwin);
 
262
 
 
263
  /* Enter the main event loop, and wait for user interaction */
 
264
  gtk_main ();
 
265
 
 
266
  /* The user lost interest */
 
267
  return 0;
 
268
}
 
269
</pre></div>
 
270
</div>
 
271
<br class="example-break"><p>
 
272
It's OK to use the GLib main loop directly instead of <a href="gtk-General.html#gtk-main"><code class="function">gtk_main()</code></a>,
 
273
though it involves slightly more typing. See <span class="type">GMainLoop</span> in the GLib
 
274
documentation.
 
275
</p>
 
276
</div>
 
277
<div class="refsect1" lang="en">
 
278
<a name="id2632173"></a><h2>Details</h2>
 
279
<div class="refsect2" lang="en">
 
280
<a name="id2632183"></a><h3>
 
281
<a name="gtk-set-locale"></a>gtk_set_locale ()</h3>
 
282
<a class="indexterm" name="id2632196"></a><pre class="programlisting">gchar*              gtk_set_locale                      (void);</pre>
 
283
<p>
 
284
Initializes internationalization support for GTK+. <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a>
 
285
automatically does this, so there is typically no point
 
286
in calling this function.
 
287
</p>
 
288
<p>
 
289
If you are calling this function because you changed the locale
 
290
after GTK+ is was initialized, then calling this function
 
291
may help a bit. (Note, however, that changing the locale
 
292
after GTK+ is initialized may produce inconsistent results and
 
293
is not really supported.)
 
294
</p>
 
295
<p>
 
296
In detail - sets the current locale according to the
 
297
program environment. This is the same as calling the C library function
 
298
<code class="literal">setlocale (LC_ALL, "")</code> but also takes care of the 
 
299
locale specific setup of the windowing system used by GDK.</p>
 
300
<p>
 
301
</p>
 
302
<div class="variablelist"><table border="0">
 
303
<col align="left" valign="top">
 
304
<tbody><tr>
 
305
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
306
<td> a string corresponding to the locale set, typically in the
 
307
form lang_COUNTRY, where lang is an ISO-639 language code, and
 
308
COUNTRY is an ISO-3166 country code. On Unix, this form matches the
 
309
result of the <code class="function">setlocale()</code>; it is also used on other machines, such as 
 
310
Windows, where the C library returns a different result. The string is 
 
311
owned by GTK+ and should not be modified or freed.
 
312
</td>
 
313
</tr></tbody>
 
314
</table></div>
 
315
</div>
 
316
<hr>
 
317
<div class="refsect2" lang="en">
 
318
<a name="id2632286"></a><h3>
 
319
<a name="gtk-disable-setlocale"></a>gtk_disable_setlocale ()</h3>
 
320
<a class="indexterm" name="id2632298"></a><pre class="programlisting">void                gtk_disable_setlocale               (void);</pre>
 
321
<p>
 
322
Prevents <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a>, <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a>, <a href="gtk-General.html#gtk-init-with-args"><code class="function">gtk_init_with_args()</code></a> and
 
323
<a href="gtk-General.html#gtk-parse-args"><code class="function">gtk_parse_args()</code></a> from automatically
 
324
calling <code class="literal">setlocale (LC_ALL, "")</code>. You would 
 
325
want to use this function if you wanted to set the locale for 
 
326
your program to something other than the user's locale, or if 
 
327
you wanted to set different values for different locale categories.
 
328
</p>
 
329
<p>
 
330
Most programs should not need to call this function.</p>
 
331
<p>
 
332
 
 
333
</p>
 
334
</div>
 
335
<hr>
 
336
<div class="refsect2" lang="en">
 
337
<a name="id2632382"></a><h3>
 
338
<a name="gtk-get-default-language"></a>gtk_get_default_language ()</h3>
 
339
<a class="indexterm" name="id2632395"></a><pre class="programlisting">PangoLanguage*      gtk_get_default_language            (void);</pre>
 
340
<p>
 
341
Returns the <span class="type">PangoLanguage</span> for the default language currently in
 
342
effect. (Note that this can change over the life of an
 
343
application.)  The default language is derived from the current
 
344
locale. It determines, for example, whether GTK+ uses the
 
345
right-to-left or left-to-right text direction. See
 
346
<code class="function">_gtk_get_lc_ctype()</code> for notes on behaviour on Windows.</p>
 
347
<p>
 
348
 
 
349
</p>
 
350
<div class="variablelist"><table border="0">
 
351
<col align="left" valign="top">
 
352
<tbody><tr>
 
353
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
354
<td> the default language as a <span class="type">PangoLanguage</span>, must not be
 
355
freed
 
356
</td>
 
357
</tr></tbody>
 
358
</table></div>
 
359
</div>
 
360
<hr>
 
361
<div class="refsect2" lang="en">
 
362
<a name="id2632470"></a><h3>
 
363
<a name="gtk-parse-args"></a>gtk_parse_args ()</h3>
 
364
<a class="indexterm" name="id2632483"></a><pre class="programlisting">gboolean            gtk_parse_args                      (int *argc,
 
365
                                                         char ***argv);</pre>
 
366
<p>
 
367
Parses command line arguments, and initializes global
 
368
attributes of GTK+, but does not actually open a connection
 
369
to a display. (See <a
 
370
href="../gdk/GdkDisplay.html#gdk-display-open"
 
371
><code class="function">gdk_display_open()</code></a>, <a
 
372
href="../gdk/gdk-General.html#gdk-get-display-arg-name"
 
373
><code class="function">gdk_get_display_arg_name()</code></a>)
 
374
</p>
 
375
<p>
 
376
Any arguments used by GTK+ or GDK are removed from the array and
 
377
<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are updated accordingly.
 
378
</p>
 
379
<p>
 
380
You shouldn't call this function explicitely if you are using
 
381
<a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a>, or <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a>.</p>
 
382
<p>
 
383
 
 
384
</p>
 
385
<div class="variablelist"><table border="0">
 
386
<col align="left" valign="top">
 
387
<tbody>
 
388
<tr>
 
389
<td><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></td>
 
390
<td> a pointer to the number of command line arguments.
 
391
</td>
 
392
</tr>
 
393
<tr>
 
394
<td><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></td>
 
395
<td> a pointer to the array of command line arguments.
 
396
</td>
 
397
</tr>
 
398
<tr>
 
399
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
400
<td> <code class="literal">TRUE</code> if initialization succeeded, otherwise <code class="literal">FALSE</code>.
 
401
</td>
 
402
</tr>
 
403
</tbody>
 
404
</table></div>
 
405
</div>
 
406
<hr>
 
407
<div class="refsect2" lang="en">
 
408
<a name="id2632653"></a><h3>
 
409
<a name="gtk-init"></a>gtk_init ()</h3>
 
410
<a class="indexterm" name="id2632665"></a><pre class="programlisting">void                gtk_init                            (int *argc,
 
411
                                                         char ***argv);</pre>
 
412
<p>
 
413
Call this function before using any other GTK+ functions in your GUI
 
414
applications.  It will initialize everything needed to operate the 
 
415
toolkit and parses some standard command line options. <em class="parameter"><code>argc</code></em> and 
 
416
<em class="parameter"><code>argv</code></em> are adjusted accordingly so your own code will 
 
417
never see those standard arguments. 
 
418
</p>
 
419
<p>
 
420
Note that there are some alternative ways to initialize GTK+: 
 
421
if you are calling <a href="gtk-General.html#gtk-parse-args"><code class="function">gtk_parse_args()</code></a>, <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a>, 
 
422
<a href="gtk-General.html#gtk-init-with-args"><code class="function">gtk_init_with_args()</code></a> or <code class="function">g_option_context_parse()</code> with 
 
423
the option group returned by <a href="gtk-General.html#gtk-get-option-group"><code class="function">gtk_get_option_group()</code></a>, you 
 
424
<span class="emphasis"><em>don't</em></span> have to call <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a>.
 
425
</p>
 
426
<p>
 
427
</p>
 
428
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
429
<h3 class="title">Note</h3>
 
430
<p>
 
431
This function will terminate your program if it was unable to initialize 
 
432
the GUI for some reason. If you want your program to fall back to a 
 
433
textual interface you want to call <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a> instead.
 
434
</p>
 
435
</div>
 
436
<p>
 
437
</p>
 
438
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
 
439
<h3 class="title">Note</h3>
 
440
<p>
 
441
</p>
 
442
</div>
 
443
<div class="variablelist"><table border="0">
 
444
<col align="left" valign="top">
 
445
<tbody>
 
446
<tr>
 
447
<td><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></td>
 
448
<td> Address of the <em class="parameter"><code>argc</code></em> parameter of your 
 
449
  <code class="function">main()</code> function. Changed if any arguments were handled.
 
450
</td>
 
451
</tr>
 
452
<tr>
 
453
<td><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></td>
 
454
<td> Address of the <em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>. 
 
455
  Any parameters understood by <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a> are stripped before return.
 
456
</td>
 
457
</tr>
 
458
</tbody>
 
459
</table></div>
 
460
</div>
 
461
<hr>
 
462
<div class="refsect2" lang="en">
 
463
<a name="id2632898"></a><h3>
 
464
<a name="gtk-init-check"></a>gtk_init_check ()</h3>
 
465
<a class="indexterm" name="id2632910"></a><pre class="programlisting">gboolean            gtk_init_check                      (int *argc,
 
466
                                                         char ***argv);</pre>
 
467
<p>
 
468
This function does the same work as <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a> with only 
 
469
a single change: It does not terminate the program if the GUI can't be 
 
470
initialized. Instead it returns <code class="literal">FALSE</code> on failure.
 
471
</p>
 
472
<p>
 
473
This way the application can fall back to some other means of communication 
 
474
with the user - for example a curses or command line interface.</p>
 
475
<p>
 
476
</p>
 
477
<div class="variablelist"><table border="0">
 
478
<col align="left" valign="top">
 
479
<tbody>
 
480
<tr>
 
481
<td><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></td>
 
482
<td> Address of the <em class="parameter"><code>argc</code></em> parameter of your 
 
483
  <code class="function">main()</code> function. Changed if any arguments were handled.
 
484
</td>
 
485
</tr>
 
486
<tr>
 
487
<td><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></td>
 
488
<td> Address of the <em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>. 
 
489
  Any parameters understood by <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a> are stripped before return.
 
490
</td>
 
491
</tr>
 
492
<tr>
 
493
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
494
<td> <code class="literal">TRUE</code> if the GUI has been successfully initialized, 
 
495
              <code class="literal">FALSE</code> otherwise.
 
496
</td>
 
497
</tr>
 
498
</tbody>
 
499
</table></div>
 
500
</div>
 
501
<hr>
 
502
<div class="refsect2" lang="en">
 
503
<a name="id2633086"></a><h3>
 
504
<a name="gtk-init-with-args"></a>gtk_init_with_args ()</h3>
 
505
<a class="indexterm" name="id2633102"></a><pre class="programlisting">gboolean            gtk_init_with_args                  (int *argc,
 
506
                                                         char ***argv,
 
507
                                                         char *parameter_string,
 
508
                                                         GOptionEntry *entries,
 
509
                                                         char *translation_domain,
 
510
                                                         GError **error);</pre>
 
511
<p>
 
512
This function does the same work as <a href="gtk-General.html#gtk-init-check"><code class="function">gtk_init_check()</code></a>. 
 
513
Additionally, it allows you to add your own commandline options, 
 
514
and it automatically generates nicely formatted 
 
515
<code class="option">--help</code> output. Note that your program will
 
516
be terminated after writing out the help output.</p>
 
517
<p>
 
518
 
 
519
</p>
 
520
<div class="variablelist"><table border="0">
 
521
<col align="left" valign="top">
 
522
<tbody>
 
523
<tr>
 
524
<td><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></td>
 
525
<td> a pointer to the number of command line arguments.
 
526
</td>
 
527
</tr>
 
528
<tr>
 
529
<td><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></td>
 
530
<td> a pointer to the array of command line arguments.
 
531
</td>
 
532
</tr>
 
533
<tr>
 
534
<td><span class="term"><em class="parameter"><code>parameter_string</code></em>&#160;:</span></td>
 
535
<td> a string which is displayed in
 
536
   the first line of <code class="option">--help</code> output, after 
 
537
   <code class="literal"><em class="replaceable"><code>programname</code></em> [OPTION...]</code>
 
538
</td>
 
539
</tr>
 
540
<tr>
 
541
<td><span class="term"><em class="parameter"><code>entries</code></em>&#160;:</span></td>
 
542
<td> a <a
 
543
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
544
><code class="literal">NULL</code></a>-terminated array of <span class="type">GOptionEntry</span>s
 
545
   describing the options of your program
 
546
</td>
 
547
</tr>
 
548
<tr>
 
549
<td><span class="term"><em class="parameter"><code>translation_domain</code></em>&#160;:</span></td>
 
550
<td> a translation domain to use for translating
 
551
   the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em>
 
552
   with <code class="function">gettext()</code>, or <a
 
553
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
554
><code class="literal">NULL</code></a>
 
555
</td>
 
556
</tr>
 
557
<tr>
 
558
<td><span class="term"><em class="parameter"><code>error</code></em>&#160;:</span></td>
 
559
<td> a return location for errors 
 
560
</td>
 
561
</tr>
 
562
<tr>
 
563
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
564
<td> <code class="literal">TRUE</code> if the GUI has been successfully initialized, 
 
565
              <code class="literal">FALSE</code> otherwise.
 
566
 
 
567
</td>
 
568
</tr>
 
569
</tbody>
 
570
</table></div>
 
571
<p class="since">Since  2.6
 
572
</p>
 
573
</div>
 
574
<hr>
 
575
<div class="refsect2" lang="en">
 
576
<a name="id2633383"></a><h3>
 
577
<a name="gtk-get-option-group"></a>gtk_get_option_group ()</h3>
 
578
<a class="indexterm" name="id2633398"></a><pre class="programlisting">GOptionGroup*       gtk_get_option_group                (gboolean open_default_display);</pre>
 
579
<p>
 
580
Returns a <span class="type">GOptionGroup</span> for the commandline arguments recognized
 
581
by GTK+ and GDK. You should add this group to your <span class="type">GOptionContext</span> 
 
582
with <code class="function">g_option_context_add_group()</code>, if you are using 
 
583
<code class="function">g_option_context_parse()</code> to parse your commandline arguments.</p>
 
584
<p>
 
585
 
 
586
</p>
 
587
<div class="variablelist"><table border="0">
 
588
<col align="left" valign="top">
 
589
<tbody>
 
590
<tr>
 
591
<td><span class="term"><em class="parameter"><code>open_default_display</code></em>&#160;:</span></td>
 
592
<td> whether to open the default display 
 
593
   when parsing the commandline arguments
 
594
</td>
 
595
</tr>
 
596
<tr>
 
597
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
598
<td>a <span class="type">GOptionGroup</span> for the commandline arguments recognized
 
599
  by GTK+
 
600
 
 
601
</td>
 
602
</tr>
 
603
</tbody>
 
604
</table></div>
 
605
<p class="since">Since  2.6
 
606
</p>
 
607
</div>
 
608
<hr>
 
609
<div class="refsect2" lang="en">
 
610
<a name="id2633519"></a><h3>
 
611
<a name="gtk-exit"></a>gtk_exit ()</h3>
 
612
<a class="indexterm" name="id2633534"></a><pre class="programlisting">void                gtk_exit                            (gint error_code);</pre>
 
613
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
614
<h3 class="title">Warning</h3>
 
615
<p><code class="literal">gtk_exit</code> is deprecated and should not be used in newly-written code. Use the standard <code class="function">exit()</code> function instead.</p>
 
616
</div>
 
617
<p>
 
618
Terminates the program and returns the given exit code to the caller. 
 
619
This function will shut down the GUI and free all resources allocated 
 
620
for GTK+.
 
621
</p>
 
622
<div class="variablelist"><table border="0">
 
623
<col align="left" valign="top">
 
624
<tbody><tr>
 
625
<td><span class="term"><em class="parameter"><code>error_code</code></em>&#160;:</span></td>
 
626
<td>Return value to pass to the caller. This is dependent on the
 
627
target system but at least on Unix systems <code class="literal">0</code> means success.
 
628
</td>
 
629
</tr></tbody>
 
630
</table></div>
 
631
</div>
 
632
<hr>
 
633
<div class="refsect2" lang="en">
 
634
<a name="id2633620"></a><h3>
 
635
<a name="gtk-events-pending"></a>gtk_events_pending ()</h3>
 
636
<a class="indexterm" name="id2633633"></a><pre class="programlisting">gboolean            gtk_events_pending                  (void);</pre>
 
637
<p>
 
638
Checks if any events are pending. This can be used to update the GUI 
 
639
and invoke timeouts etc. while doing some time intensive computation.
 
640
</p>
 
641
<div class="example">
 
642
<a name="id2633656"></a><p class="title"><b>Example&#160;2.&#160;Updating the GUI during a long computation.</b></p>
 
643
<div class="example-contents"><pre class="programlisting">
 
644
        /* computation going on */
 
645
...
 
646
        while (gtk_events_pending ())
 
647
          gtk_main_iteration ();
 
648
...
 
649
        /* computation continued */
 
650
</pre></div>
 
651
</div>
 
652
<br class="example-break"><div class="variablelist"><table border="0">
 
653
<col align="left" valign="top">
 
654
<tbody><tr>
 
655
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
656
<td>
 
657
<code class="literal">TRUE</code> if any events are pending, <code class="literal">FALSE</code> otherwise.
 
658
 
 
659
 
 
660
</td>
 
661
</tr></tbody>
 
662
</table></div>
 
663
</div>
 
664
<hr>
 
665
<div class="refsect2" lang="en">
 
666
<a name="id2633711"></a><h3>
 
667
<a name="gtk-main"></a>gtk_main ()</h3>
 
668
<a class="indexterm" name="id2633723"></a><pre class="programlisting">void                gtk_main                            (void);</pre>
 
669
<p>
 
670
Runs the main loop until <a href="gtk-General.html#gtk-main-quit"><code class="function">gtk_main_quit()</code></a> is called. You can nest calls to
 
671
<a href="gtk-General.html#gtk-main"><code class="function">gtk_main()</code></a>. In that case <a href="gtk-General.html#gtk-main-quit"><code class="function">gtk_main_quit()</code></a> will make the innermost invocation
 
672
of the main loop return.
 
673
</p>
 
674
</div>
 
675
<hr>
 
676
<div class="refsect2" lang="en">
 
677
<a name="id2633778"></a><h3>
 
678
<a name="gtk-main-level"></a>gtk_main_level ()</h3>
 
679
<a class="indexterm" name="id2633790"></a><pre class="programlisting">guint               gtk_main_level                      (void);</pre>
 
680
<p>
 
681
Asks for the current nesting level of the main loop. This can be useful
 
682
when calling <a href="gtk-General.html#gtk-quit-add"><code class="function">gtk_quit_add()</code></a>.
 
683
</p>
 
684
<div class="variablelist"><table border="0">
 
685
<col align="left" valign="top">
 
686
<tbody><tr>
 
687
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
688
<td>the nesting level of the current invocation of the main loop.
 
689
 
 
690
 
 
691
</td>
 
692
</tr></tbody>
 
693
</table></div>
 
694
</div>
 
695
<hr>
 
696
<div class="refsect2" lang="en">
 
697
<a name="id2633839"></a><h3>
 
698
<a name="gtk-main-quit"></a>gtk_main_quit ()</h3>
 
699
<a class="indexterm" name="id2633852"></a><pre class="programlisting">void                gtk_main_quit                       (void);</pre>
 
700
<p>
 
701
Makes the innermost invocation of the main loop return when it regains 
 
702
control.
 
703
</p>
 
704
</div>
 
705
<hr>
 
706
<div class="refsect2" lang="en">
 
707
<a name="id2633874"></a><h3>
 
708
<a name="gtk-main-iteration"></a>gtk_main_iteration ()</h3>
 
709
<a class="indexterm" name="id2633887"></a><pre class="programlisting">gboolean            gtk_main_iteration                  (void);</pre>
 
710
<p>
 
711
Runs a single iteration of the mainloop. If no events are waiting to be
 
712
processed GTK+ will block until the next event is noticed. If you don't
 
713
want to block look at <a href="gtk-General.html#gtk-main-iteration-do"><code class="function">gtk_main_iteration_do()</code></a> or check if any events are
 
714
pending with <a href="gtk-General.html#gtk-events-pending"><code class="function">gtk_events_pending()</code></a> first.
 
715
</p>
 
716
<div class="variablelist"><table border="0">
 
717
<col align="left" valign="top">
 
718
<tbody><tr>
 
719
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
720
<td>
 
721
<code class="literal">TRUE</code> if <a href="gtk-General.html#gtk-main-quit"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.
 
722
 
 
723
 
 
724
</td>
 
725
</tr></tbody>
 
726
</table></div>
 
727
</div>
 
728
<hr>
 
729
<div class="refsect2" lang="en">
 
730
<a name="id2633969"></a><h3>
 
731
<a name="gtk-main-iteration-do"></a>gtk_main_iteration_do ()</h3>
 
732
<a class="indexterm" name="id2633981"></a><pre class="programlisting">gboolean            gtk_main_iteration_do               (gboolean blocking);</pre>
 
733
<p>
 
734
Runs a single iteration of the mainloop. If no events are available either
 
735
return or block dependent on the value of <em class="parameter"><code>blocking</code></em>. 
 
736
</p>
 
737
<div class="variablelist"><table border="0">
 
738
<col align="left" valign="top">
 
739
<tbody>
 
740
<tr>
 
741
<td><span class="term"><em class="parameter"><code>blocking</code></em>&#160;:</span></td>
 
742
<td>
 
743
<code class="literal">TRUE</code> if you want GTK+ to block if no events are pending.
 
744
</td>
 
745
</tr>
 
746
<tr>
 
747
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
748
<td>
 
749
<code class="literal">TRUE</code> if <a href="gtk-General.html#gtk-main-quit"><code class="function">gtk_main_quit()</code></a> has been called for the innermost mainloop.
 
750
 
 
751
 
 
752
</td>
 
753
</tr>
 
754
</tbody>
 
755
</table></div>
 
756
</div>
 
757
<hr>
 
758
<div class="refsect2" lang="en">
 
759
<a name="id2634076"></a><h3>
 
760
<a name="gtk-main-do-event"></a>gtk_main_do_event ()</h3>
 
761
<a class="indexterm" name="id2634089"></a><pre class="programlisting">void                gtk_main_do_event                   (<a
 
762
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
763
>GdkEvent</a> *event);</pre>
 
764
<p>
 
765
Processes a single GDK event. This is public only to allow filtering of events
 
766
between GDK and GTK+. You will not usually need to call this function directly.
 
767
</p>
 
768
<p>
 
769
While you should not call this function directly, you might want to know
 
770
how exactly events are handled. So here is what this function does with 
 
771
the event:
 
772
</p>
 
773
<div class="orderedlist"><ol type="1">
 
774
<li><p>
 
775
  Compress enter/leave notify events. If the event passed build an 
 
776
  enter/leave pair together with the next event (peeked from GDK)
 
777
  both events are thrown away. This is to avoid a backlog of (de-)highlighting
 
778
  widgets crossed by the pointer.
 
779
</p></li>
 
780
<li><p>
 
781
  Find the widget which got the event. If the widget can't be determined 
 
782
  the event is thrown away unless it belongs to a INCR transaction. In that
 
783
  case it is passed to <code class="function">gtk_selection_incr_event()</code>.
 
784
</p></li>
 
785
<li><p>
 
786
  Then the event is passed on a stack so you can query the currently handled
 
787
  event with <a href="gtk-General.html#gtk-get-current-event"><code class="function">gtk_get_current_event()</code></a>. 
 
788
</p></li>
 
789
<li>
 
790
<p>
 
791
  The event is sent to a widget. If a grab is active all events for 
 
792
  widgets that are not in the contained in the grab widget are sent to the 
 
793
  latter with a few exceptions: 
 
794
 
 
795
  </p>
 
796
<div class="itemizedlist"><ul type="disc">
 
797
<li><p>
 
798
    Deletion and destruction events are still sent to the event widget for
 
799
    obvious reasons.
 
800
  </p></li>
 
801
<li><p>
 
802
    Events which directly relate to the visual representation of the event
 
803
    widget.
 
804
  </p></li>
 
805
<li><p>
 
806
    Leave events are delivered to the event widget if there was an enter 
 
807
    event delivered to it before without the paired leave event.
 
808
  </p></li>
 
809
<li><p>
 
810
    Drag events are not redirected because it is unclear what the semantics
 
811
    of that would be.
 
812
  </p></li>
 
813
</ul></div>
 
814
<p>
 
815
 
 
816
  Another point of interest might be that all key events are first passed
 
817
  through the key snooper functions if there are any. Read the description
 
818
  of <a href="gtk-General.html#gtk-key-snooper-install"><code class="function">gtk_key_snooper_install()</code></a> if you need this feature.
 
819
</p>
 
820
</li>
 
821
<li><p>
 
822
  After finishing the delivery the event is popped from the event stack.
 
823
</p></li>
 
824
</ol></div>
 
825
<div class="variablelist"><table border="0">
 
826
<col align="left" valign="top">
 
827
<tbody><tr>
 
828
<td><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></td>
 
829
<td>An event to process (normally) passed by GDK.
 
830
 
 
831
 
 
832
</td>
 
833
</tr></tbody>
 
834
</table></div>
 
835
</div>
 
836
<hr>
 
837
<div class="refsect2" lang="en">
 
838
<a name="id2634252"></a><h3>
 
839
<a name="GtkModuleInitFunc"></a>GtkModuleInitFunc ()</h3>
 
840
<a class="indexterm" name="id2634266"></a><pre class="programlisting">void                (*GtkModuleInitFunc)                (gint *argc,
 
841
                                                         gchar ***argv);</pre>
 
842
<p>
 
843
Each GTK+ module must have a function <code class="function">gtk_module_init()</code> with this prototype.
 
844
This function is called after loading the module with the <em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> 
 
845
cleaned from any arguments that GTK+ handles itself.
 
846
</p>
 
847
<div class="variablelist"><table border="0">
 
848
<col align="left" valign="top">
 
849
<tbody>
 
850
<tr>
 
851
<td><span class="term"><em class="parameter"><code>argc</code></em>&#160;:</span></td>
 
852
<td>Pointer to the number of arguments remaining after <a href="gtk-General.html#gtk-init"><code class="function">gtk_init()</code></a>.
 
853
</td>
 
854
</tr>
 
855
<tr>
 
856
<td><span class="term"><em class="parameter"><code>argv</code></em>&#160;:</span></td>
 
857
<td>Points to the argument vector.
 
858
 
 
859
 
 
860
</td>
 
861
</tr>
 
862
</tbody>
 
863
</table></div>
 
864
</div>
 
865
<hr>
 
866
<div class="refsect2" lang="en">
 
867
<a name="id2634371"></a><h3>
 
868
<a name="GtkModuleDisplayInitFunc"></a>GtkModuleDisplayInitFunc ()</h3>
 
869
<a class="indexterm" name="id2634386"></a><pre class="programlisting">void                (*GtkModuleDisplayInitFunc)         (<a
 
870
href="../gdk/GdkDisplay.html"
 
871
>GdkDisplay</a> *display);</pre>
 
872
<p>
 
873
 
 
874
</p>
 
875
<div class="variablelist"><table border="0">
 
876
<col align="left" valign="top">
 
877
<tbody><tr>
 
878
<td><span class="term"><em class="parameter"><code>display</code></em>&#160;:</span></td>
 
879
<td>
 
880
</td>
 
881
</tr></tbody>
 
882
</table></div>
 
883
<p class="since">Since 2.2
 
884
 
 
885
 
 
886
</p>
 
887
</div>
 
888
<hr>
 
889
<div class="refsect2" lang="en">
 
890
<a name="id2634439"></a><h3>
 
891
<a name="gtk-true"></a>gtk_true ()</h3>
 
892
<a class="indexterm" name="id2634451"></a><pre class="programlisting">gboolean            gtk_true                            (void);</pre>
 
893
<p>
 
894
All this function does it to return <code class="literal">TRUE</code>. This can be useful for example
 
895
if you want to inhibit the deletion of a window. Of course you should 
 
896
not do this as the user expects a reaction from clicking the close 
 
897
icon of the window...
 
898
</p>
 
899
<div class="example">
 
900
<a name="id2634487"></a><p class="title"><b>Example&#160;3.&#160;A persistent window</b></p>
 
901
<div class="example-contents"><pre class="programlisting">
 
902
##include &lt;gtk/gtk.h&gt;
 
903
 
 
904
int
 
905
main (int argc, char **argv)
 
906
{
 
907
  GtkWidget     *win, *but;
 
908
 
 
909
  gtk_init( &amp;argc, &amp;argv );
 
910
 
 
911
  win = gtk_window_new (GTK_WINDOW_TOPLEVEL);
 
912
  g_signal_connect (win, "delete-event",
 
913
                    G_CALLBACK (gtk_true), NULL);
 
914
  g_signal_connect (win, "destroy",
 
915
                    G_CALLBACK (gtk_main_quit), NULL);
 
916
 
 
917
  but = gtk_button_new_with_label ("Close yourself. I mean it!");
 
918
  g_signal_connect_swapped (but, "clicked",
 
919
                  G_CALLBACK (gtk_object_destroy), win);
 
920
  gtk_container_add (GTK_CONTAINER (win), but);
 
921
 
 
922
  gtk_widget_show_all (win);
 
923
  gtk_main ();
 
924
  return 0;
 
925
}
 
926
</pre></div>
 
927
</div>
 
928
<br class="example-break"><div class="variablelist"><table border="0">
 
929
<col align="left" valign="top">
 
930
<tbody><tr>
 
931
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
932
<td>
 
933
<code class="literal">TRUE</code>
 
934
 
 
935
 
 
936
</td>
 
937
</tr></tbody>
 
938
</table></div>
 
939
</div>
 
940
<hr>
 
941
<div class="refsect2" lang="en">
 
942
<a name="id2634548"></a><h3>
 
943
<a name="gtk-false"></a>gtk_false ()</h3>
 
944
<a class="indexterm" name="id2634560"></a><pre class="programlisting">gboolean            gtk_false                           (void);</pre>
 
945
<p>
 
946
Analogical to <a href="gtk-General.html#gtk-true"><code class="function">gtk_true()</code></a> this function does nothing 
 
947
but always returns <code class="literal">FALSE</code>.
 
948
</p>
 
949
<div class="variablelist"><table border="0">
 
950
<col align="left" valign="top">
 
951
<tbody><tr>
 
952
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
953
<td>
 
954
<code class="literal">FALSE</code>
 
955
 
 
956
 
 
957
</td>
 
958
</tr></tbody>
 
959
</table></div>
 
960
</div>
 
961
<hr>
 
962
<div class="refsect2" lang="en">
 
963
<a name="id2634626"></a><h3>
 
964
<a name="gtk-grab-add"></a>gtk_grab_add ()</h3>
 
965
<a class="indexterm" name="id2634639"></a><pre class="programlisting">void                gtk_grab_add                        (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre>
 
966
<p>
 
967
Makes <em class="parameter"><code>widget</code></em> the current grabbed widget. This means that interaction with 
 
968
other widgets in the same application is blocked and mouse as well as 
 
969
keyboard events are delivered to this widget.
 
970
</p>
 
971
<div class="variablelist"><table border="0">
 
972
<col align="left" valign="top">
 
973
<tbody><tr>
 
974
<td><span class="term"><em class="parameter"><code>widget</code></em>&#160;:</span></td>
 
975
<td>The widget that grabs keyboard and pointer events.
 
976
 
 
977
 
 
978
</td>
 
979
</tr></tbody>
 
980
</table></div>
 
981
</div>
 
982
<hr>
 
983
<div class="refsect2" lang="en">
 
984
<a name="id2634695"></a><h3>
 
985
<a name="gtk-grab-get-current"></a>gtk_grab_get_current ()</h3>
 
986
<a class="indexterm" name="id2634708"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_grab_get_current                (void);</pre>
 
987
<p>
 
988
Queries the current grab of the default window group. 
 
989
</p>
 
990
<div class="variablelist"><table border="0">
 
991
<col align="left" valign="top">
 
992
<tbody><tr>
 
993
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
994
<td>The widget which currently has the grab or <a
 
995
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
996
><code class="literal">NULL</code></a> if no grab is active.
 
997
 
 
998
 
 
999
</td>
 
1000
</tr></tbody>
 
1001
</table></div>
 
1002
</div>
 
1003
<hr>
 
1004
<div class="refsect2" lang="en">
 
1005
<a name="id2634756"></a><h3>
 
1006
<a name="gtk-grab-remove"></a>gtk_grab_remove ()</h3>
 
1007
<a class="indexterm" name="id2634769"></a><pre class="programlisting">void                gtk_grab_remove                     (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget);</pre>
 
1008
<p>
 
1009
Removes the grab from the given widget. You have to pair calls to <a href="gtk-General.html#gtk-grab-add"><code class="function">gtk_grab_add()</code></a>
 
1010
and <a href="gtk-General.html#gtk-grab-remove"><code class="function">gtk_grab_remove()</code></a>.
 
1011
</p>
 
1012
<div class="variablelist"><table border="0">
 
1013
<col align="left" valign="top">
 
1014
<tbody><tr>
 
1015
<td><span class="term"><em class="parameter"><code>widget</code></em>&#160;:</span></td>
 
1016
<td>The widget which gives up the grab.
 
1017
 
 
1018
 
 
1019
</td>
 
1020
</tr></tbody>
 
1021
</table></div>
 
1022
</div>
 
1023
<hr>
 
1024
<div class="refsect2" lang="en">
 
1025
<a name="id2634838"></a><h3>
 
1026
<a name="gtk-init-add"></a>gtk_init_add ()</h3>
 
1027
<a class="indexterm" name="id2634850"></a><pre class="programlisting">void                gtk_init_add                        (<a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1028
                                                         gpointer data);</pre>
 
1029
<p>
 
1030
Registers a function to be called when the mainloop is started.
 
1031
</p>
 
1032
<div class="variablelist"><table border="0">
 
1033
<col align="left" valign="top">
 
1034
<tbody>
 
1035
<tr>
 
1036
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1037
<td>Function to invoke when <a href="gtk-General.html#gtk-main"><code class="function">gtk_main()</code></a> is called next.
 
1038
</td>
 
1039
</tr>
 
1040
<tr>
 
1041
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1042
<td>Data to pass to that function.
 
1043
 
 
1044
 
 
1045
</td>
 
1046
</tr>
 
1047
</tbody>
 
1048
</table></div>
 
1049
</div>
 
1050
<hr>
 
1051
<div class="refsect2" lang="en">
 
1052
<a name="id2634931"></a><h3>
 
1053
<a name="gtk-quit-add-destroy"></a>gtk_quit_add_destroy ()</h3>
 
1054
<a class="indexterm" name="id2634943"></a><pre class="programlisting">void                gtk_quit_add_destroy                (guint main_level,
 
1055
                                                         <a href="GtkObject.html" title="GtkObject">GtkObject</a> *object);</pre>
 
1056
<p>
 
1057
Trigger destruction of <em class="parameter"><code>object</code></em> in case the mainloop at level <em class="parameter"><code>main_level</code></em>
 
1058
is quit.
 
1059
</p>
 
1060
<div class="variablelist"><table border="0">
 
1061
<col align="left" valign="top">
 
1062
<tbody>
 
1063
<tr>
 
1064
<td><span class="term"><em class="parameter"><code>main_level</code></em>&#160;:</span></td>
 
1065
<td>Level of the mainloop which shall trigger the destruction.
 
1066
</td>
 
1067
</tr>
 
1068
<tr>
 
1069
<td><span class="term"><em class="parameter"><code>object</code></em>&#160;:</span></td>
 
1070
<td>Object to be destroyed.
 
1071
 
 
1072
 
 
1073
</td>
 
1074
</tr>
 
1075
</tbody>
 
1076
</table></div>
 
1077
</div>
 
1078
<hr>
 
1079
<div class="refsect2" lang="en">
 
1080
<a name="id2635026"></a><h3>
 
1081
<a name="gtk-quit-add"></a>gtk_quit_add ()</h3>
 
1082
<a class="indexterm" name="id2635038"></a><pre class="programlisting">guint               gtk_quit_add                        (guint main_level,
 
1083
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1084
                                                         gpointer data);</pre>
 
1085
<p>
 
1086
Registers a function to be called when an instance of the mainloop is left.
 
1087
</p>
 
1088
<div class="variablelist"><table border="0">
 
1089
<col align="left" valign="top">
 
1090
<tbody>
 
1091
<tr>
 
1092
<td><span class="term"><em class="parameter"><code>main_level</code></em>&#160;:</span></td>
 
1093
<td>Level at which termination the function shall be called. You
 
1094
 can pass 0 here to have the function run at the termination of the current
 
1095
 mainloop.
 
1096
</td>
 
1097
</tr>
 
1098
<tr>
 
1099
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1100
<td>The function to call. This should return 0 to be removed from the 
 
1101
 list of quit handlers. Otherwise the function might be called again.
 
1102
</td>
 
1103
</tr>
 
1104
<tr>
 
1105
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1106
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.
 
1107
</td>
 
1108
</tr>
 
1109
<tr>
 
1110
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1111
<td>A handle for this quit handler (you need this for <a href="gtk-General.html#gtk-quit-remove"><code class="function">gtk_quit_remove()</code></a>)
 
1112
  or 0 if you passed a <a
 
1113
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1114
><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.
 
1115
 
 
1116
 
 
1117
</td>
 
1118
</tr>
 
1119
</tbody>
 
1120
</table></div>
 
1121
</div>
 
1122
<hr>
 
1123
<div class="refsect2" lang="en">
 
1124
<a name="id2635178"></a><h3>
 
1125
<a name="gtk-quit-add-full"></a>gtk_quit_add_full ()</h3>
 
1126
<a class="indexterm" name="id2635192"></a><pre class="programlisting">guint               gtk_quit_add_full                   (guint main_level,
 
1127
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1128
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
1129
                                                         gpointer data,
 
1130
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);</pre>
 
1131
<p>
 
1132
Registers a function to be called when an instance of the mainloop is left.
 
1133
In comparison to <a href="gtk-General.html#gtk-quit-add"><code class="function">gtk_quit_add()</code></a> this function adds the possibility to 
 
1134
pass a marshaller and a function to be called when the quit handler is freed.
 
1135
</p>
 
1136
<p>
 
1137
The former can be used to run interpreted code instead of a compiled function
 
1138
while the latter can be used to free the information stored in <em class="parameter"><code>data</code></em> (while
 
1139
you can do this in <em class="parameter"><code>function</code></em> as well)... So this function will mostly be
 
1140
used by GTK+ wrappers for languages other than C.
 
1141
</p>
 
1142
<div class="variablelist"><table border="0">
 
1143
<col align="left" valign="top">
 
1144
<tbody>
 
1145
<tr>
 
1146
<td><span class="term"><em class="parameter"><code>main_level</code></em>&#160;:</span></td>
 
1147
<td>Level at which termination the function shall be called. You
 
1148
 can pass 0 here to have the function run at the termination of the current
 
1149
 mainloop.
 
1150
</td>
 
1151
</tr>
 
1152
<tr>
 
1153
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1154
<td>The function to call. This should return 0 to be removed from the 
 
1155
 list of quit handlers. Otherwise the function might be called again.
 
1156
</td>
 
1157
</tr>
 
1158
<tr>
 
1159
<td><span class="term"><em class="parameter"><code>marshal</code></em>&#160;:</span></td>
 
1160
<td>The marshaller to be used. If this is non-<a
 
1161
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1162
><code class="literal">NULL</code></a>, <em class="parameter"><code>function</code></em> is 
 
1163
 ignored.
 
1164
</td>
 
1165
</tr>
 
1166
<tr>
 
1167
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1168
<td>Pointer to pass when calling <em class="parameter"><code>function</code></em>.
 
1169
</td>
 
1170
</tr>
 
1171
<tr>
 
1172
<td><span class="term"><em class="parameter"><code>destroy</code></em>&#160;:</span></td>
 
1173
<td>Function to call to destruct <em class="parameter"><code>data</code></em>. Gets <em class="parameter"><code>data</code></em> as argument.
 
1174
</td>
 
1175
</tr>
 
1176
<tr>
 
1177
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1178
<td>A handle for this quit handler (you need this for <a href="gtk-General.html#gtk-quit-remove"><code class="function">gtk_quit_remove()</code></a>)
 
1179
  or 0 if you passed a <a
 
1180
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1181
><code class="literal">NULL</code></a> pointer in <em class="parameter"><code>function</code></em>.
 
1182
 
 
1183
 
 
1184
</td>
 
1185
</tr>
 
1186
</tbody>
 
1187
</table></div>
 
1188
</div>
 
1189
<hr>
 
1190
<div class="refsect2" lang="en">
 
1191
<a name="id2635437"></a><h3>
 
1192
<a name="gtk-quit-remove"></a>gtk_quit_remove ()</h3>
 
1193
<a class="indexterm" name="id2635450"></a><pre class="programlisting">void                gtk_quit_remove                     (guint quit_handler_id);</pre>
 
1194
<p>
 
1195
Removes a quit handler by its identifier.
 
1196
</p>
 
1197
<div class="variablelist"><table border="0">
 
1198
<col align="left" valign="top">
 
1199
<tbody><tr>
 
1200
<td><span class="term"><em class="parameter"><code>quit_handler_id</code></em>&#160;:</span></td>
 
1201
<td>Identifier for the handler returned when installing it.
 
1202
 
 
1203
 
 
1204
</td>
 
1205
</tr></tbody>
 
1206
</table></div>
 
1207
</div>
 
1208
<hr>
 
1209
<div class="refsect2" lang="en">
 
1210
<a name="id2635498"></a><h3>
 
1211
<a name="gtk-quit-remove-by-data"></a>gtk_quit_remove_by_data ()</h3>
 
1212
<a class="indexterm" name="id2635511"></a><pre class="programlisting">void                gtk_quit_remove_by_data             (gpointer data);</pre>
 
1213
<p>
 
1214
Removes a quit handler identified by its <em class="parameter"><code>data</code></em> field.
 
1215
</p>
 
1216
<div class="variablelist"><table border="0">
 
1217
<col align="left" valign="top">
 
1218
<tbody><tr>
 
1219
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1220
<td>The pointer passed as <em class="parameter"><code>data</code></em> to <a href="gtk-General.html#gtk-quit-add"><code class="function">gtk_quit_add()</code></a> or <a href="gtk-General.html#gtk-quit-add-full"><code class="function">gtk_quit_add_full()</code></a>.
 
1221
 
 
1222
 
 
1223
</td>
 
1224
</tr></tbody>
 
1225
</table></div>
 
1226
</div>
 
1227
<hr>
 
1228
<div class="refsect2" lang="en">
 
1229
<a name="id2635592"></a><h3>
 
1230
<a name="gtk-timeout-add-full"></a>gtk_timeout_add_full ()</h3>
 
1231
<a class="indexterm" name="id2635608"></a><pre class="programlisting">guint               gtk_timeout_add_full                (guint32 interval,
 
1232
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1233
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
1234
                                                         gpointer data,
 
1235
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);</pre>
 
1236
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1237
<h3 class="title">Warning</h3>
 
1238
<p><code class="literal">gtk_timeout_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_timeout_add_full()</code> instead.</p>
 
1239
</div>
 
1240
<p>
 
1241
Registers a function to be called periodically. The function will be called
 
1242
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <code class="literal">FALSE</code> at which 
 
1243
point the timeout is destroyed and will not be called again.
 
1244
</p>
 
1245
<div class="variablelist"><table border="0">
 
1246
<col align="left" valign="top">
 
1247
<tbody>
 
1248
<tr>
 
1249
<td><span class="term"><em class="parameter"><code>interval</code></em>&#160;:</span></td>
 
1250
<td>The time between calls to the function, in milliseconds 
 
1251
        (1/1000ths of a second.)
 
1252
</td>
 
1253
</tr>
 
1254
<tr>
 
1255
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1256
<td>The function to call periodically.
 
1257
</td>
 
1258
</tr>
 
1259
<tr>
 
1260
<td><span class="term"><em class="parameter"><code>marshal</code></em>&#160;:</span></td>
 
1261
<td>The marshaller to use instead of the function (if non-<a
 
1262
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1263
><code class="literal">NULL</code></a>).
 
1264
</td>
 
1265
</tr>
 
1266
<tr>
 
1267
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1268
<td>The data to pass to the function.
 
1269
</td>
 
1270
</tr>
 
1271
<tr>
 
1272
<td><span class="term"><em class="parameter"><code>destroy</code></em>&#160;:</span></td>
 
1273
<td>Function to call when the timeout is destroyed or <a
 
1274
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1275
><code class="literal">NULL</code></a>.
 
1276
</td>
 
1277
</tr>
 
1278
<tr>
 
1279
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1280
<td>A unique id for the event source.
 
1281
</td>
 
1282
</tr>
 
1283
</tbody>
 
1284
</table></div>
 
1285
</div>
 
1286
<hr>
 
1287
<div class="refsect2" lang="en">
 
1288
<a name="id2635821"></a><h3>
 
1289
<a name="gtk-timeout-add"></a>gtk_timeout_add ()</h3>
 
1290
<a class="indexterm" name="id2635836"></a><pre class="programlisting">guint               gtk_timeout_add                     (guint32 interval,
 
1291
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1292
                                                         gpointer data);</pre>
 
1293
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1294
<h3 class="title">Warning</h3>
 
1295
<p><code class="literal">gtk_timeout_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_timeout_add()</code> instead.</p>
 
1296
</div>
 
1297
<p>
 
1298
Registers a function to be called periodically. The function will be called
 
1299
repeatedly after <em class="parameter"><code>interval</code></em> milliseconds until it returns <code class="literal">FALSE</code> at which 
 
1300
point the timeout is destroyed and will not be called again.
 
1301
</p>
 
1302
<div class="variablelist"><table border="0">
 
1303
<col align="left" valign="top">
 
1304
<tbody>
 
1305
<tr>
 
1306
<td><span class="term"><em class="parameter"><code>interval</code></em>&#160;:</span></td>
 
1307
<td>The time between calls to the function, in milliseconds 
 
1308
        (1/1000ths of a second.)
 
1309
</td>
 
1310
</tr>
 
1311
<tr>
 
1312
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1313
<td>The function to call periodically.
 
1314
</td>
 
1315
</tr>
 
1316
<tr>
 
1317
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1318
<td>The data to pass to the function.
 
1319
</td>
 
1320
</tr>
 
1321
<tr>
 
1322
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1323
<td>A unique id for the event source.
 
1324
</td>
 
1325
</tr>
 
1326
</tbody>
 
1327
</table></div>
 
1328
</div>
 
1329
<hr>
 
1330
<div class="refsect2" lang="en">
 
1331
<a name="id2635983"></a><h3>
 
1332
<a name="gtk-timeout-remove"></a>gtk_timeout_remove ()</h3>
 
1333
<a class="indexterm" name="id2635998"></a><pre class="programlisting">void                gtk_timeout_remove                  (guint timeout_handler_id);</pre>
 
1334
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1335
<h3 class="title">Warning</h3>
 
1336
<p><code class="literal">gtk_timeout_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_source_remove()</code> instead.</p>
 
1337
</div>
 
1338
<p>
 
1339
Removes the given timeout destroying all information about it.
 
1340
</p>
 
1341
<div class="variablelist"><table border="0">
 
1342
<col align="left" valign="top">
 
1343
<tbody><tr>
 
1344
<td><span class="term"><em class="parameter"><code>timeout_handler_id</code></em>&#160;:</span></td>
 
1345
<td>The identifier returned when installing the timeout.
 
1346
</td>
 
1347
</tr></tbody>
 
1348
</table></div>
 
1349
</div>
 
1350
<hr>
 
1351
<div class="refsect2" lang="en">
 
1352
<a name="id2636071"></a><h3>
 
1353
<a name="gtk-idle-add"></a>gtk_idle_add ()</h3>
 
1354
<a class="indexterm" name="id2636087"></a><pre class="programlisting">guint               gtk_idle_add                        (<a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1355
                                                         gpointer data);</pre>
 
1356
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1357
<h3 class="title">Warning</h3>
 
1358
<p><code class="literal">gtk_idle_add</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_idle_add()</code> instead.</p>
 
1359
</div>
 
1360
<p>
 
1361
Causes the mainloop to call the given function whenever no events with 
 
1362
higher priority are to be processed. The default priority is 
 
1363
<a href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS"><code class="literal">GTK_PRIORITY_DEFAULT</code></a>, which is rather low.
 
1364
</p>
 
1365
<div class="variablelist"><table border="0">
 
1366
<col align="left" valign="top">
 
1367
<tbody>
 
1368
<tr>
 
1369
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1370
<td>The function to call.
 
1371
</td>
 
1372
</tr>
 
1373
<tr>
 
1374
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1375
<td>The information to pass to the function.
 
1376
</td>
 
1377
</tr>
 
1378
<tr>
 
1379
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1380
<td>a unique handle for this registration.
 
1381
</td>
 
1382
</tr>
 
1383
</tbody>
 
1384
</table></div>
 
1385
</div>
 
1386
<hr>
 
1387
<div class="refsect2" lang="en">
 
1388
<a name="id2636205"></a><h3>
 
1389
<a name="gtk-idle-add-priority"></a>gtk_idle_add_priority ()</h3>
 
1390
<a class="indexterm" name="id2636221"></a><pre class="programlisting">guint               gtk_idle_add_priority               (gint priority,
 
1391
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1392
                                                         gpointer data);</pre>
 
1393
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1394
<h3 class="title">Warning</h3>
 
1395
<p><code class="literal">gtk_idle_add_priority</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_idle_add_full()</code> instead.</p>
 
1396
</div>
 
1397
<p>
 
1398
Like <a href="gtk-General.html#gtk-idle-add"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
 
1399
when the event loop is idle. The difference is that you can give a 
 
1400
priority different from <a href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
 
1401
</p>
 
1402
<div class="variablelist"><table border="0">
 
1403
<col align="left" valign="top">
 
1404
<tbody>
 
1405
<tr>
 
1406
<td><span class="term"><em class="parameter"><code>priority</code></em>&#160;:</span></td>
 
1407
<td>The priority which should not be above <code class="literal">G_PRIORITY_HIGH_IDLE</code>.
 
1408
Note that you will interfere with GTK+ if you use a priority above
 
1409
<a href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.
 
1410
</td>
 
1411
</tr>
 
1412
<tr>
 
1413
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1414
<td>The function to call.
 
1415
</td>
 
1416
</tr>
 
1417
<tr>
 
1418
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1419
<td>Data to pass to that function.
 
1420
</td>
 
1421
</tr>
 
1422
<tr>
 
1423
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1424
<td>A unique id for the event source.
 
1425
</td>
 
1426
</tr>
 
1427
</tbody>
 
1428
</table></div>
 
1429
</div>
 
1430
<hr>
 
1431
<div class="refsect2" lang="en">
 
1432
<a name="id2636396"></a><h3>
 
1433
<a name="gtk-idle-add-full"></a>gtk_idle_add_full ()</h3>
 
1434
<a class="indexterm" name="id2636412"></a><pre class="programlisting">guint               gtk_idle_add_full                   (gint priority,
 
1435
                                                         <a href="gtk-Types.html#GtkFunction">GtkFunction</a> function,
 
1436
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
1437
                                                         gpointer data,
 
1438
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);</pre>
 
1439
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1440
<h3 class="title">Warning</h3>
 
1441
<p><code class="literal">gtk_idle_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_idle_add_full()</code> instead.</p>
 
1442
</div>
 
1443
<p>
 
1444
Like <a href="gtk-General.html#gtk-idle-add"><code class="function">gtk_idle_add()</code></a> this function allows you to have a function called
 
1445
when the event loop is idle. The difference is that you can give a 
 
1446
priority different from <a href="gtk-General.html#GTK-PRIORITY-DEFAULT:CAPS"><code class="literal">GTK_PRIORITY_DEFAULT</code></a> to the idle function.
 
1447
</p>
 
1448
<div class="variablelist"><table border="0">
 
1449
<col align="left" valign="top">
 
1450
<tbody>
 
1451
<tr>
 
1452
<td><span class="term"><em class="parameter"><code>priority</code></em>&#160;:</span></td>
 
1453
<td>The priority which should not be above <code class="literal">G_PRIORITY_HIGH_IDLE</code>.
 
1454
Note that you will interfere with GTK+ if you use a priority above
 
1455
<a href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS"><code class="literal">GTK_PRIORITY_RESIZE</code></a>.
 
1456
</td>
 
1457
</tr>
 
1458
<tr>
 
1459
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1460
<td>The function to call.
 
1461
</td>
 
1462
</tr>
 
1463
<tr>
 
1464
<td><span class="term"><em class="parameter"><code>marshal</code></em>&#160;:</span></td>
 
1465
<td>The marshaller to use instead of the function (if non-<a
 
1466
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1467
><code class="literal">NULL</code></a>).
 
1468
</td>
 
1469
</tr>
 
1470
<tr>
 
1471
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1472
<td>Data to pass to that function.
 
1473
</td>
 
1474
</tr>
 
1475
<tr>
 
1476
<td><span class="term"><em class="parameter"><code>destroy</code></em>&#160;:</span></td>
 
1477
<td>Function to call when the timeout is destroyed or <a
 
1478
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1479
><code class="literal">NULL</code></a>.
 
1480
</td>
 
1481
</tr>
 
1482
<tr>
 
1483
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1484
<td>A unique id for the event source.
 
1485
</td>
 
1486
</tr>
 
1487
</tbody>
 
1488
</table></div>
 
1489
</div>
 
1490
<hr>
 
1491
<div class="refsect2" lang="en">
 
1492
<a name="id2636650"></a><h3>
 
1493
<a name="gtk-idle-remove"></a>gtk_idle_remove ()</h3>
 
1494
<a class="indexterm" name="id2636666"></a><pre class="programlisting">void                gtk_idle_remove                     (guint idle_handler_id);</pre>
 
1495
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1496
<h3 class="title">Warning</h3>
 
1497
<p><code class="literal">gtk_idle_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_source_remove()</code> instead.</p>
 
1498
</div>
 
1499
<p>
 
1500
Removes the idle function with the given id.
 
1501
</p>
 
1502
<div class="variablelist"><table border="0">
 
1503
<col align="left" valign="top">
 
1504
<tbody><tr>
 
1505
<td><span class="term"><em class="parameter"><code>idle_handler_id</code></em>&#160;:</span></td>
 
1506
<td>Identifies the idle function to remove.
 
1507
</td>
 
1508
</tr></tbody>
 
1509
</table></div>
 
1510
</div>
 
1511
<hr>
 
1512
<div class="refsect2" lang="en">
 
1513
<a name="id2636738"></a><h3>
 
1514
<a name="gtk-idle-remove-by-data"></a>gtk_idle_remove_by_data ()</h3>
 
1515
<a class="indexterm" name="id2636754"></a><pre class="programlisting">void                gtk_idle_remove_by_data             (gpointer data);</pre>
 
1516
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1517
<h3 class="title">Warning</h3>
 
1518
<p><code class="literal">gtk_idle_remove_by_data</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_idle_remove_by_data()</code> instead.</p>
 
1519
</div>
 
1520
<p>
 
1521
Removes the idle function identified by the user data.
 
1522
</p>
 
1523
<div class="variablelist"><table border="0">
 
1524
<col align="left" valign="top">
 
1525
<tbody><tr>
 
1526
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1527
<td>remove the idle function which was registered with this user data.
 
1528
</td>
 
1529
</tr></tbody>
 
1530
</table></div>
 
1531
</div>
 
1532
<hr>
 
1533
<div class="refsect2" lang="en">
 
1534
<a name="id2636828"></a><h3>
 
1535
<a name="gtk-input-add-full"></a>gtk_input_add_full ()</h3>
 
1536
<a class="indexterm" name="id2636844"></a><pre class="programlisting">guint               gtk_input_add_full                  (gint source,
 
1537
                                                         <a
 
1538
href="../gdk/gdk-Input.html#GdkInputCondition"
 
1539
>GdkInputCondition</a> condition,
 
1540
                                                         <a
 
1541
href="../gdk/gdk-Input.html#GdkInputFunction"
 
1542
>GdkInputFunction</a> function,
 
1543
                                                         <a href="gtk-Types.html#GtkCallbackMarshal">GtkCallbackMarshal</a> marshal,
 
1544
                                                         gpointer data,
 
1545
                                                         <a href="gtk-Types.html#GtkDestroyNotify">GtkDestroyNotify</a> destroy);</pre>
 
1546
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1547
<h3 class="title">Warning</h3>
 
1548
<p><code class="literal">gtk_input_add_full</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_io_add_watch_full()</code> instead.</p>
 
1549
</div>
 
1550
<p>
 
1551
Registers a function to be called when a condition becomes true 
 
1552
on a file descriptor.
 
1553
</p>
 
1554
<div class="variablelist"><table border="0">
 
1555
<col align="left" valign="top">
 
1556
<tbody>
 
1557
<tr>
 
1558
<td><span class="term"><em class="parameter"><code>source</code></em>&#160;:</span></td>
 
1559
<td>a file descriptor.
 
1560
</td>
 
1561
</tr>
 
1562
<tr>
 
1563
<td><span class="term"><em class="parameter"><code>condition</code></em>&#160;:</span></td>
 
1564
<td>the condition.
 
1565
</td>
 
1566
</tr>
 
1567
<tr>
 
1568
<td><span class="term"><em class="parameter"><code>function</code></em>&#160;:</span></td>
 
1569
<td>The function to call.
 
1570
</td>
 
1571
</tr>
 
1572
<tr>
 
1573
<td><span class="term"><em class="parameter"><code>marshal</code></em>&#160;:</span></td>
 
1574
<td>The marshaller to use instead of the function (if non-<a
 
1575
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1576
><code class="literal">NULL</code></a>).
 
1577
</td>
 
1578
</tr>
 
1579
<tr>
 
1580
<td><span class="term"><em class="parameter"><code>data</code></em>&#160;:</span></td>
 
1581
<td>callback data passed to <em class="parameter"><code>function</code></em>.
 
1582
</td>
 
1583
</tr>
 
1584
<tr>
 
1585
<td><span class="term"><em class="parameter"><code>destroy</code></em>&#160;:</span></td>
 
1586
<td>callback function to call with <em class="parameter"><code>data</code></em> when the input
 
1587
  handler is removed, or <a
 
1588
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1589
><code class="literal">NULL</code></a>.
 
1590
</td>
 
1591
</tr>
 
1592
<tr>
 
1593
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1594
<td>A unique id for the event source; to be used with <a href="gtk-General.html#gtk-input-remove"><code class="function">gtk_input_remove()</code></a>.
 
1595
</td>
 
1596
</tr>
 
1597
</tbody>
 
1598
</table></div>
 
1599
</div>
 
1600
<hr>
 
1601
<div class="refsect2" lang="en">
 
1602
<a name="id2637082"></a><h3>
 
1603
<a name="gtk-input-remove"></a>gtk_input_remove ()</h3>
 
1604
<a class="indexterm" name="id2637097"></a><pre class="programlisting">void                gtk_input_remove                    (guint input_handler_id);</pre>
 
1605
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1606
<h3 class="title">Warning</h3>
 
1607
<p><code class="literal">gtk_input_remove</code> has been deprecated since version 2.4 and should not be used in newly-written code. Use <code class="function">g_source_remove()</code> instead.</p>
 
1608
</div>
 
1609
<p>
 
1610
Removes the function with the given id.
 
1611
</p>
 
1612
<div class="variablelist"><table border="0">
 
1613
<col align="left" valign="top">
 
1614
<tbody><tr>
 
1615
<td><span class="term"><em class="parameter"><code>input_handler_id</code></em>&#160;:</span></td>
 
1616
<td>Identifies the function to remove.
 
1617
</td>
 
1618
</tr></tbody>
 
1619
</table></div>
 
1620
</div>
 
1621
<hr>
 
1622
<div class="refsect2" lang="en">
 
1623
<a name="id2637169"></a><h3>
 
1624
<a name="GTK-PRIORITY-REDRAW:CAPS"></a>GTK_PRIORITY_REDRAW</h3>
 
1625
<a class="indexterm" name="id2637186"></a><pre class="programlisting">#define GTK_PRIORITY_REDRAW     (G_PRIORITY_HIGH_IDLE + 20)
 
1626
</pre>
 
1627
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1628
<h3 class="title">Warning</h3>
 
1629
<p><code class="literal">GTK_PRIORITY_REDRAW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <a
 
1630
href="../gdk/gdk-Events.html#GDK-PRIORITY-REDRAW:CAPS"
 
1631
><code class="literal">GDK_PRIORITY_REDRAW</code></a> instead.</p>
 
1632
</div>
 
1633
<p>
 
1634
Use this priority for redrawing related stuff. It is used internally by
 
1635
GTK+ to do pending redraws. This priority is lower than <a href="gtk-General.html#GTK-PRIORITY-RESIZE:CAPS"><code class="literal">GTK_PRIORITY_RESIZE</code></a>
 
1636
to avoid redrawing a widget just before resizing (and therefore redrawing
 
1637
it again).
 
1638
</p>
 
1639
</div>
 
1640
<hr>
 
1641
<div class="refsect2" lang="en">
 
1642
<a name="id2637242"></a><h3>
 
1643
<a name="GTK-PRIORITY-RESIZE:CAPS"></a>GTK_PRIORITY_RESIZE</h3>
 
1644
<a class="indexterm" name="id2637255"></a><pre class="programlisting">#define GTK_PRIORITY_RESIZE     (G_PRIORITY_HIGH_IDLE + 10)
 
1645
</pre>
 
1646
<p>
 
1647
Use this priority for resizing related stuff. It is used internally by
 
1648
GTK+ to compute the sizes of widgets. This priority is higher than 
 
1649
<a href="gtk-General.html#GTK-PRIORITY-REDRAW:CAPS"><code class="literal">GTK_PRIORITY_REDRAW</code></a> to avoid resizing a widget which was just redrawn.
 
1650
</p>
 
1651
</div>
 
1652
<hr>
 
1653
<div class="refsect2" lang="en">
 
1654
<a name="id2637285"></a><h3>
 
1655
<a name="GTK-PRIORITY-HIGH:CAPS"></a>GTK_PRIORITY_HIGH</h3>
 
1656
<a class="indexterm" name="id2637301"></a><pre class="programlisting">#define GTK_PRIORITY_HIGH       G_PRIORITY_HIGH
 
1657
</pre>
 
1658
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1659
<h3 class="title">Warning</h3>
 
1660
<p><code class="literal">GTK_PRIORITY_HIGH</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <code class="literal">G_PRIORITY_HIGH</code> instead.</p>
 
1661
</div>
 
1662
<p>
 
1663
Use this for high priority timeouts. This priority is never used inside
 
1664
GTK+ so everything running at this priority will be running before anything
 
1665
inside the toolkit.
 
1666
</p>
 
1667
</div>
 
1668
<hr>
 
1669
<div class="refsect2" lang="en">
 
1670
<a name="id2637345"></a><h3>
 
1671
<a name="GTK-PRIORITY-INTERNAL:CAPS"></a>GTK_PRIORITY_INTERNAL</h3>
 
1672
<a class="indexterm" name="id2637360"></a><pre class="programlisting">#define GTK_PRIORITY_INTERNAL   GTK_PRIORITY_REDRAW
 
1673
</pre>
 
1674
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1675
<h3 class="title">Warning</h3>
 
1676
<p><code class="literal">GTK_PRIORITY_INTERNAL</code> is deprecated and should not be used in newly-written code.</p>
 
1677
</div>
 
1678
<p>
 
1679
This priority is for GTK+ internal stuff. Don't use it in your applications.
 
1680
</p>
 
1681
</div>
 
1682
<hr>
 
1683
<div class="refsect2" lang="en">
 
1684
<a name="id2637390"></a><h3>
 
1685
<a name="GTK-PRIORITY-DEFAULT:CAPS"></a>GTK_PRIORITY_DEFAULT</h3>
 
1686
<a class="indexterm" name="id2637407"></a><pre class="programlisting">#define GTK_PRIORITY_DEFAULT      G_PRIORITY_DEFAULT_IDLE
 
1687
</pre>
 
1688
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1689
<h3 class="title">Warning</h3>
 
1690
<p><code class="literal">GTK_PRIORITY_DEFAULT</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <code class="literal">G_PRIORITY_DEFAULT_IDLE</code> instead.</p>
 
1691
</div>
 
1692
<p>
 
1693
Default priority for idle functions.
 
1694
</p>
 
1695
</div>
 
1696
<hr>
 
1697
<div class="refsect2" lang="en">
 
1698
<a name="id2637450"></a><h3>
 
1699
<a name="GTK-PRIORITY-LOW:CAPS"></a>GTK_PRIORITY_LOW</h3>
 
1700
<a class="indexterm" name="id2637467"></a><pre class="programlisting">#define GTK_PRIORITY_LOW  G_PRIORITY_LOW
 
1701
</pre>
 
1702
<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;">
 
1703
<h3 class="title">Warning</h3>
 
1704
<p><code class="literal">GTK_PRIORITY_LOW</code> has been deprecated since version 2.4 and should not be used in newly-written code. This macro is deprecated. You should use <code class="literal">G_PRIORITY_LOW</code> instead.</p>
 
1705
</div>
 
1706
<p>
 
1707
Priority for very unimportant background tasks.
 
1708
</p>
 
1709
</div>
 
1710
<hr>
 
1711
<div class="refsect2" lang="en">
 
1712
<a name="id2637508"></a><h3>
 
1713
<a name="gtk-key-snooper-install"></a>gtk_key_snooper_install ()</h3>
 
1714
<a class="indexterm" name="id2637521"></a><pre class="programlisting">guint               gtk_key_snooper_install             (<a href="gtk-General.html#GtkKeySnoopFunc">GtkKeySnoopFunc</a> snooper,
 
1715
                                                         gpointer func_data);</pre>
 
1716
<p>
 
1717
Installs a key snooper function, which will get called on all key events
 
1718
before delivering them normally.
 
1719
</p>
 
1720
<div class="variablelist"><table border="0">
 
1721
<col align="left" valign="top">
 
1722
<tbody>
 
1723
<tr>
 
1724
<td><span class="term"><em class="parameter"><code>snooper</code></em>&#160;:</span></td>
 
1725
<td>a <a href="gtk-General.html#GtkKeySnoopFunc"><span class="type">GtkKeySnoopFunc</span></a>.
 
1726
</td>
 
1727
</tr>
 
1728
<tr>
 
1729
<td><span class="term"><em class="parameter"><code>func_data</code></em>&#160;:</span></td>
 
1730
<td>data to pass to <em class="parameter"><code>snooper</code></em>.
 
1731
</td>
 
1732
</tr>
 
1733
<tr>
 
1734
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1735
<td>a unique id for this key snooper for use with <a href="gtk-General.html#gtk-key-snooper-remove"><code class="function">gtk_key_snooper_remove()</code></a>.
 
1736
 
 
1737
 
 
1738
</td>
 
1739
</tr>
 
1740
</tbody>
 
1741
</table></div>
 
1742
</div>
 
1743
<hr>
 
1744
<div class="refsect2" lang="en">
 
1745
<a name="id2637628"></a><h3>
 
1746
<a name="GtkKeySnoopFunc"></a>GtkKeySnoopFunc ()</h3>
 
1747
<a class="indexterm" name="id2637640"></a><pre class="programlisting">gint                (*GtkKeySnoopFunc)                  (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *grab_widget,
 
1748
                                                         <a
 
1749
href="../gdk/gdk-Event-Structures.html#GdkEventKey"
 
1750
>GdkEventKey</a> *event,
 
1751
                                                         gpointer func_data);</pre>
 
1752
<p>
 
1753
Key snooper functions are called before normal event delivery.
 
1754
They can be used to implement custom key event handling.
 
1755
</p>
 
1756
<div class="variablelist"><table border="0">
 
1757
<col align="left" valign="top">
 
1758
<tbody>
 
1759
<tr>
 
1760
<td><span class="term"><em class="parameter"><code>grab_widget</code></em>&#160;:</span></td>
 
1761
<td>the widget to which the event will be delivered.
 
1762
</td>
 
1763
</tr>
 
1764
<tr>
 
1765
<td><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></td>
 
1766
<td>the key event.
 
1767
</td>
 
1768
</tr>
 
1769
<tr>
 
1770
<td><span class="term"><em class="parameter"><code>func_data</code></em>&#160;:</span></td>
 
1771
<td>the <em class="parameter"><code>func_data</code></em> supplied to <a href="gtk-General.html#gtk-key-snooper-install"><code class="function">gtk_key_snooper_install()</code></a>.
 
1772
</td>
 
1773
</tr>
 
1774
<tr>
 
1775
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1776
<td>
 
1777
<code class="literal">TRUE</code> to stop further processing of <em class="parameter"><code>event</code></em>, <code class="literal">FALSE</code> to continue.
 
1778
 
 
1779
 
 
1780
</td>
 
1781
</tr>
 
1782
</tbody>
 
1783
</table></div>
 
1784
</div>
 
1785
<hr>
 
1786
<div class="refsect2" lang="en">
 
1787
<a name="id2637785"></a><h3>
 
1788
<a name="gtk-key-snooper-remove"></a>gtk_key_snooper_remove ()</h3>
 
1789
<a class="indexterm" name="id2637798"></a><pre class="programlisting">void                gtk_key_snooper_remove              (guint snooper_handler_id);</pre>
 
1790
<p>
 
1791
Removes the key snooper function with the given id.
 
1792
</p>
 
1793
<div class="variablelist"><table border="0">
 
1794
<col align="left" valign="top">
 
1795
<tbody><tr>
 
1796
<td><span class="term"><em class="parameter"><code>snooper_handler_id</code></em>&#160;:</span></td>
 
1797
<td>Identifies the key snooper to remove.
 
1798
 
 
1799
 
 
1800
</td>
 
1801
</tr></tbody>
 
1802
</table></div>
 
1803
</div>
 
1804
<hr>
 
1805
<div class="refsect2" lang="en">
 
1806
<a name="id2637846"></a><h3>
 
1807
<a name="gtk-get-current-event"></a>gtk_get_current_event ()</h3>
 
1808
<a class="indexterm" name="id2637860"></a><pre class="programlisting"><a
 
1809
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
1810
>GdkEvent</a>*           gtk_get_current_event               (void);</pre>
 
1811
<p>
 
1812
Obtains a copy of the event currently being processed by GTK+.  For
 
1813
example, if you get a "clicked" signal from <a href="GtkButton.html" title="GtkButton"><span class="type">GtkButton</span></a>, the current
 
1814
event will be the <a
 
1815
href="../gdk/gdk-Event-Structures.html#GdkEventButton"
 
1816
><span class="type">GdkEventButton</span></a> that triggered the "clicked"
 
1817
signal. The returned event must be freed with <a
 
1818
href="../gdk/gdk-Events.html#gdk-event-free"
 
1819
><code class="function">gdk_event_free()</code></a>.
 
1820
If there is no current event, the function returns <a
 
1821
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1822
><code class="literal">NULL</code></a>.</p>
 
1823
<p>
 
1824
 
 
1825
</p>
 
1826
<div class="variablelist"><table border="0">
 
1827
<col align="left" valign="top">
 
1828
<tbody><tr>
 
1829
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1830
<td> a copy of the current event, or <a
 
1831
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1832
><code class="literal">NULL</code></a> if no current event.
 
1833
</td>
 
1834
</tr></tbody>
 
1835
</table></div>
 
1836
</div>
 
1837
<hr>
 
1838
<div class="refsect2" lang="en">
 
1839
<a name="id2637954"></a><h3>
 
1840
<a name="gtk-get-current-event-time"></a>gtk_get_current_event_time ()</h3>
 
1841
<a class="indexterm" name="id2637968"></a><pre class="programlisting">guint32             gtk_get_current_event_time          (void);</pre>
 
1842
<p>
 
1843
If there is a current event and it has a timestamp, return that
 
1844
timestamp, otherwise return <a
 
1845
href="../gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"
 
1846
><code class="literal">GDK_CURRENT_TIME</code></a>.</p>
 
1847
<p>
 
1848
 
 
1849
</p>
 
1850
<div class="variablelist"><table border="0">
 
1851
<col align="left" valign="top">
 
1852
<tbody><tr>
 
1853
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1854
<td> the timestamp from the current event, or <a
 
1855
href="../gdk/gdk-Events.html#GDK-CURRENT-TIME:CAPS"
 
1856
><code class="literal">GDK_CURRENT_TIME</code></a>.
 
1857
</td>
 
1858
</tr></tbody>
 
1859
</table></div>
 
1860
</div>
 
1861
<hr>
 
1862
<div class="refsect2" lang="en">
 
1863
<a name="id2638033"></a><h3>
 
1864
<a name="gtk-get-current-event-state"></a>gtk_get_current_event_state ()</h3>
 
1865
<a class="indexterm" name="id2638046"></a><pre class="programlisting">gboolean            gtk_get_current_event_state         (<a
 
1866
href="../gdk/gdk-Windows.html#GdkModifierType"
 
1867
>GdkModifierType</a> *state);</pre>
 
1868
<p>
 
1869
If there is a current event and it has a state field, place
 
1870
that state field in <em class="parameter"><code>state</code></em> and return <code class="literal">TRUE</code>, otherwise return
 
1871
<code class="literal">FALSE</code>.</p>
 
1872
<p>
 
1873
 
 
1874
</p>
 
1875
<div class="variablelist"><table border="0">
 
1876
<col align="left" valign="top">
 
1877
<tbody>
 
1878
<tr>
 
1879
<td><span class="term"><em class="parameter"><code>state</code></em>&#160;:</span></td>
 
1880
<td> a location to store the state of the current event
 
1881
</td>
 
1882
</tr>
 
1883
<tr>
 
1884
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1885
<td> <code class="literal">TRUE</code> if there was a current event and it had a state field
 
1886
</td>
 
1887
</tr>
 
1888
</tbody>
 
1889
</table></div>
 
1890
</div>
 
1891
<hr>
 
1892
<div class="refsect2" lang="en">
 
1893
<a name="id2638146"></a><h3>
 
1894
<a name="gtk-get-event-widget"></a>gtk_get_event_widget ()</h3>
 
1895
<a class="indexterm" name="id2638158"></a><pre class="programlisting"><a href="GtkWidget.html" title="GtkWidget">GtkWidget</a>*          gtk_get_event_widget                (<a
 
1896
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
1897
>GdkEvent</a> *event);</pre>
 
1898
<p>
 
1899
If <em class="parameter"><code>event</code></em> is <a
 
1900
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1901
><code class="literal">NULL</code></a> or the event was not associated with any widget,
 
1902
returns <a
 
1903
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1904
><code class="literal">NULL</code></a>, otherwise returns the widget that received the event
 
1905
originally.</p>
 
1906
<p>
 
1907
 
 
1908
</p>
 
1909
<div class="variablelist"><table border="0">
 
1910
<col align="left" valign="top">
 
1911
<tbody>
 
1912
<tr>
 
1913
<td><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></td>
 
1914
<td> a <a
 
1915
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
1916
><span class="type">GdkEvent</span></a>
 
1917
</td>
 
1918
</tr>
 
1919
<tr>
 
1920
<td><span class="term"><span class="emphasis"><em>Returns</em></span>&#160;:</span></td>
 
1921
<td> the widget that originally received <em class="parameter"><code>event</code></em>, or <a
 
1922
href="../liboil/liboil-liboiljunk.html#NULL:CAPS"
 
1923
><code class="literal">NULL</code></a>
 
1924
</td>
 
1925
</tr>
 
1926
</tbody>
 
1927
</table></div>
 
1928
</div>
 
1929
<hr>
 
1930
<div class="refsect2" lang="en">
 
1931
<a name="id2638271"></a><h3>
 
1932
<a name="gtk-propagate-event"></a>gtk_propagate_event ()</h3>
 
1933
<a class="indexterm" name="id2638284"></a><pre class="programlisting">void                gtk_propagate_event                 (<a href="GtkWidget.html" title="GtkWidget">GtkWidget</a> *widget,
 
1934
                                                         <a
 
1935
href="../gdk/gdk-Event-Structures.html#GdkEvent"
 
1936
>GdkEvent</a> *event);</pre>
 
1937
<p>
 
1938
Sends an event to a widget, propagating the event to parent widgets
 
1939
if the event remains unhandled. Events received by GTK+ from GDK
 
1940
normally begin in <a href="gtk-General.html#gtk-main-do-event"><code class="function">gtk_main_do_event()</code></a>. Depending on the type of
 
1941
event, existence of modal dialogs, grabs, etc., the event may be
 
1942
propagated; if so, this function is used. <a href="gtk-General.html#gtk-propagate-event"><code class="function">gtk_propagate_event()</code></a>
 
1943
calls <a href="GtkWidget.html#gtk-widget-event"><code class="function">gtk_widget_event()</code></a> on each widget it decides to send the
 
1944
event to.  So <a href="GtkWidget.html#gtk-widget-event"><code class="function">gtk_widget_event()</code></a> is the lowest-level function; it
 
1945
simply emits the "event" and possibly an event-specific signal on a
 
1946
widget.  <a href="gtk-General.html#gtk-propagate-event"><code class="function">gtk_propagate_event()</code></a> is a bit higher-level, and
 
1947
<a href="gtk-General.html#gtk-main-do-event"><code class="function">gtk_main_do_event()</code></a> is the highest level.
 
1948
</p>
 
1949
<p>
 
1950
All that said, you most likely don't want to use any of these
 
1951
functions; synthesizing events is rarely needed. Consider asking on
 
1952
the mailing list for better ways to achieve your goals. For
 
1953
example, use <a
 
1954
href="../gdk/gdk-Windows.html#gdk-window-invalidate-rect"
 
1955
><code class="function">gdk_window_invalidate_rect()</code></a> or
 
1956
<a href="GtkWidget.html#gtk-widget-queue-draw"><code class="function">gtk_widget_queue_draw()</code></a> instead of making up expose events.</p>
 
1957
<p>
 
1958
 
 
1959
</p>
 
1960
<div class="variablelist"><table border="0">
 
1961
<col align="left" valign="top">
 
1962
<tbody>
 
1963
<tr>
 
1964
<td><span class="term"><em class="parameter"><code>widget</code></em>&#160;:</span></td>
 
1965
<td> a <a href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a>
 
1966
</td>
 
1967
</tr>
 
1968
<tr>
 
1969
<td><span class="term"><em class="parameter"><code>event</code></em>&#160;:</span></td>
 
1970
<td> an event
 
1971
</td>
 
1972
</tr>
 
1973
</tbody>
 
1974
</table></div>
 
1975
</div>
 
1976
</div>
 
1977
<div class="refsect1" lang="en">
 
1978
<a name="id2638469"></a><h2>See Also</h2>
 
1979
<p>
 
1980
See the GLib manual, especially <span class="type">GMainLoop</span> and signal-related
 
1981
functions such as <code class="function">g_signal_connect()</code>.
 
1982
</p>
 
1983
</div>
 
1984
</div>
 
1985
</body>
 
1986
</html>