diff options
Diffstat (limited to 'gtk+-mingw/share/gtk-doc/html/gtk3/gtk3-General.html')
-rw-r--r-- | gtk+-mingw/share/gtk-doc/html/gtk3/gtk3-General.html | 1239 |
1 files changed, 0 insertions, 1239 deletions
diff --git a/gtk+-mingw/share/gtk-doc/html/gtk3/gtk3-General.html b/gtk+-mingw/share/gtk-doc/html/gtk3/gtk3-General.html deleted file mode 100644 index a21a2c5..0000000 --- a/gtk+-mingw/share/gtk-doc/html/gtk3/gtk3-General.html +++ /dev/null @@ -1,1239 +0,0 @@ -<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> -<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> -<title>Main loop and Events</title> -<meta name="generator" content="DocBook XSL Stylesheets V1.76.1"> -<link rel="home" href="index.html" title="GTK+ 3 Reference Manual"> -<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference"> -<link rel="prev" href="gtkbase.html" title="Part II. GTK+ Core Reference"> -<link rel="next" href="gtk3-Feature-Test-Macros.html" title="Version Information"> -<meta name="generator" content="GTK-Doc V1.18.1 (XML mode)"> -<link rel="stylesheet" href="style.css" type="text/css"> -</head> -<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> -<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2"> -<tr valign="middle"> -<td><a accesskey="p" href="gtkbase.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td> -<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td> -<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td> -<th width="100%" align="center">GTK+ 3 Reference Manual</th> -<td><a accesskey="n" href="gtk3-Feature-Test-Macros.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td> -</tr> -<tr><td colspan="5" class="shortcuts"> -<a href="#gtk3-General.synopsis" class="shortcut">Top</a> - | - <a href="#gtk3-General.description" class="shortcut">Description</a> -</td></tr> -</table> -<div class="refentry"> -<a name="gtk3-General"></a><div class="titlepage"></div> -<div class="refnamediv"><table width="100%"><tr> -<td valign="top"> -<h2><span class="refentrytitle"><a name="gtk3-General.top_of_page"></a>Main loop and Events</span></h2> -<p>Main loop and Events — Library initialization, main event loop, and events</p> -</td> -<td valign="top" align="right"></td> -</tr></table></div> -<div class="refsynopsisdiv"> -<a name="gtk3-General.synopsis"></a><h2>Synopsis</h2> -<pre class="synopsis"> -#include <gtk/gtk.h> - -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-disable-setlocale" title="gtk_disable_setlocale ()">gtk_disable_setlocale</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="returnvalue">PangoLanguage</span></a> * <a class="link" href="gtk3-General.html#gtk-get-default-language" title="gtk_get_default_language ()">gtk_get_default_language</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-parse-args" title="gtk_parse_args ()">gtk_parse_args</a> (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()">gtk_init</a> (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()">gtk_init_check</a> (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-init-with-args" title="gtk_init_with_args ()">gtk_init_with_args</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *parameter_string</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> *entries</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *translation_domain</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> * <a class="link" href="gtk3-General.html#gtk-get-option-group" title="gtk_get_option_group ()">gtk_get_option_group</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> open_default_display</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-events-pending" title="gtk_events_pending ()">gtk_events_pending</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()">gtk_main</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gtk3-General.html#gtk-main-level" title="gtk_main_level ()">gtk_main_level</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()">gtk_main_quit</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-main-iteration" title="gtk_main_iteration ()">gtk_main_iteration</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()">gtk_main_iteration_do</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-main-do-event" title="gtk_main_do_event ()">gtk_main_do_event</a> (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>); -<span class="returnvalue">void</span> (<a class="link" href="gtk3-General.html#GtkModuleInitFunc" title="GtkModuleInitFunc ()">*GtkModuleInitFunc</a>) (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>); -<span class="returnvalue">void</span> (<a class="link" href="gtk3-General.html#GtkModuleDisplayInitFunc" title="GtkModuleDisplayInitFunc ()">*GtkModuleDisplayInitFunc</a>) (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> *display</code></em>); - -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-true" title="gtk_true ()">gtk_true</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-false" title="gtk_false ()">gtk_false</a> (<em class="parameter"><code><span class="type">void</span></code></em>); - -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-grab-add" title="gtk_grab_add ()">gtk_grab_add</a> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>); -<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="gtk3-General.html#gtk-grab-get-current" title="gtk_grab_get_current ()">gtk_grab_get_current</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-grab-remove" title="gtk_grab_remove ()">gtk_grab_remove</a> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-device-grab-add" title="gtk_device_grab_add ()">gtk_device_grab_add</a> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> block_others</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-device-grab-remove" title="gtk_device_grab_remove ()">gtk_device_grab_remove</a> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>); - -#define <a class="link" href="gtk3-General.html#GTK-PRIORITY-RESIZE:CAPS" title="GTK_PRIORITY_RESIZE">GTK_PRIORITY_RESIZE</a> - -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> <a class="link" href="gtk3-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()">gtk_key_snooper_install</a> (<em class="parameter"><code><a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> snooper</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> (<a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()">*GtkKeySnoopFunc</a>) (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *grab_widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> *event</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()">gtk_key_snooper_remove</a> (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> snooper_handler_id</code></em>); - -<a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> * <a class="link" href="gtk3-General.html#gtk-get-current-event" title="gtk_get_current_event ()">gtk_get_current_event</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> <a class="link" href="gtk3-General.html#gtk-get-current-event-time" title="gtk_get_current_event_time ()">gtk_get_current_event_time</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> <a class="link" href="gtk3-General.html#gtk-get-current-event-state" title="gtk_get_current_event_state ()">gtk_get_current_event_state</a> (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>); -<a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="returnvalue">GdkDevice</span></a> * <a class="link" href="gtk3-General.html#gtk-get-current-event-device" title="gtk_get_current_event_device ()">gtk_get_current_event_device</a> (<em class="parameter"><code><span class="type">void</span></code></em>); -<a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * <a class="link" href="gtk3-General.html#gtk-get-event-widget" title="gtk_get_event_widget ()">gtk_get_event_widget</a> (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>); -<span class="returnvalue">void</span> <a class="link" href="gtk3-General.html#gtk-propagate-event" title="gtk_propagate_event ()">gtk_propagate_event</a> (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>); -</pre> -</div> -<div class="refsect1"> -<a name="gtk3-General.description"></a><h2>Description</h2> -<p> -Before using GTK+, you need to initialize it; initialization connects to the -window system display, and parses some standard command line arguments. The -<a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> macro initializes GTK+. <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> exits the application if errors -occur; to avoid this, use <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> allows you to -recover from a failed GTK+ initialization - you might start up your -application in text mode instead. -</p> -<p> -Like all GUI toolkits, GTK+ uses an event-driven programming model. When the -user is doing nothing, GTK+ sits in the <em class="firstterm">main loop</em> and -waits for input. If the user performs some action - say, a mouse click - then -the main loop "wakes up" and delivers an event to GTK+. GTK+ forwards the -event to one or more widgets. -</p> -<p> -When widgets receive an event, they frequently emit one or more -<em class="firstterm">signals</em>. Signals notify your program that "something -interesting happened" by invoking functions you've connected to the signal -with <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a>. Functions connected to a signal are often termed -<em class="firstterm">callbacks</em>. -</p> -<p> -When your callbacks are invoked, you would typically take some action - for -example, when an Open button is clicked you might display a -<a class="link" href="GtkFileChooserDialog.html" title="GtkFileChooserDialog"><span class="type">GtkFileChooserDialog</span></a>. After a callback finishes, GTK+ will return to the -main loop and await more user input. -</p> -<div class="example"> -<a name="id513793"></a><p class="title"><b>Example 6. Typical <code class="function"><code class="function">main()</code></code> function for a GTK+ application</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="type">int</span> -<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">argv</span><span class="symbol">)</span> -<span class="cbracket">{</span> -<span class="normal"> </span><span class="comment">/* Initialize i18n support */</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gtk3/gtk-General.html#gtk-set-locale">gtk_set_locale</a></span><span class="normal"> </span><span class="symbol">();</span> - -<span class="normal"> </span><span class="comment">/* Initialize the widget set */</span> -<span class="normal"> </span><span class="function"><a href="gtk3-General.html#gtk-init">gtk_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">argv</span><span class="symbol">);</span> - -<span class="normal"> </span><span class="comment">/* Create the main window */</span> -<span class="normal"> mainwin </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk3-Standard-Enumerations.html#GTK-WINDOW-TOPLEVEL:CAPS">GTK_WINDOW_TOPLEVEL</a></span><span class="symbol">);</span> - -<span class="normal"> </span><span class="comment">/* Set up our GUI elements */</span> -<span class="normal"> </span><span class="symbol">...</span> - -<span class="normal"> </span><span class="comment">/* Show the application window */</span> -<span class="normal"> </span><span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">mainwin</span><span class="symbol">);</span> - -<span class="normal"> </span><span class="comment">/* Enter the main event loop, and wait for user interaction */</span> -<span class="normal"> </span><span class="function"><a href="gtk3-General.html#gtk-main">gtk_main</a></span><span class="normal"> </span><span class="symbol">();</span> - -<span class="normal"> </span><span class="comment">/* The user lost interest */</span> -<span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<br class="example-break"><p> -It's OK to use the GLib main loop directly instead of <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>, though it -involves slightly more typing. See <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> in the GLib documentation. -</p> -</div> -<div class="refsect1"> -<a name="gtk3-General.details"></a><h2>Details</h2> -<div class="refsect2"> -<a name="gtk-disable-setlocale"></a><h3>gtk_disable_setlocale ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_disable_setlocale (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Prevents <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, <a class="link" href="gtk3-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> and -<a class="link" href="gtk3-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a> from automatically -calling <code class="literal">setlocale (LC_ALL, "")</code>. You would -want to use this function if you wanted to set the locale for -your program to something other than the user's locale, or if -you wanted to set different values for different locale categories. -</p> -<p> -Most programs should not need to call this function. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-default-language"></a><h3>gtk_get_default_language ()</h3> -<pre class="programlisting"><a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="returnvalue">PangoLanguage</span></a> * gtk_get_default_language (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Returns the <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="type">PangoLanguage</span></a> for the default language currently in -effect. (Note that this can change over the life of an -application.) The default language is derived from the current -locale. It determines, for example, whether GTK+ uses the -right-to-left or left-to-right text direction. -</p> -<p> -This function is equivalent to <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#pango-language-get-default"><code class="function">pango_language_get_default()</code></a>. -See that function for details. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the default language as a <a href="/home/mclasen/gnome/share/gtk-doc/html/pango/pango-Scripts-and-Languages.html#PangoLanguage"><span class="type">PangoLanguage</span></a>, -must not be freed</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-parse-args"></a><h3>gtk_parse_args ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_parse_args (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre> -<p> -Parses command line arguments, and initializes global -attributes of GTK+, but does not actually open a connection -to a display. (See <a href="http://developer.gnome.org/gdk/GdkDisplay.html#gdk-display-open"><code class="function">gdk_display_open()</code></a>, <a href="http://developer.gnome.org/gdk/gdk3-General.html#gdk-get-display-arg-name"><code class="function">gdk_get_display_arg_name()</code></a>) -</p> -<p> -Any arguments used by GTK+ or GDK are removed from the array and -<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are updated accordingly. -</p> -<p> -There is no need to call this function explicitely if you are using -<a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, or <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td> -<td>a pointer to the number of command line arguments. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td> -<td>a pointer to the array of -command line arguments. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if initialization succeeded, otherwise <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-init"></a><h3>gtk_init ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_init (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre> -<p> -Call this function before using any other GTK+ functions in your GUI -applications. It will initialize everything needed to operate the -toolkit and parses some standard command line options. -</p> -<p> -Although you are expected to pass the <em class="parameter"><code>argc</code></em>, <em class="parameter"><code>argv</code></em> parameters from <code class="function">main()</code> to -this function, it is possible to pass <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if <em class="parameter"><code>argv</code></em> is not available or -commandline handling is not required. -</p> -<p> -<em class="parameter"><code>argc</code></em> and <em class="parameter"><code>argv</code></em> are adjusted accordingly so your own code will -never see those standard arguments. -</p> -<p> -Note that there are some alternative ways to initialize GTK+: -if you are calling <a class="link" href="gtk3-General.html#gtk-parse-args" title="gtk_parse_args ()"><code class="function">gtk_parse_args()</code></a>, <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>, -<a class="link" href="gtk3-General.html#gtk-init-with-args" title="gtk_init_with_args ()"><code class="function">gtk_init_with_args()</code></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> with -the option group returned by <a class="link" href="gtk3-General.html#gtk-get-option-group" title="gtk_get_option_group ()"><code class="function">gtk_get_option_group()</code></a>, -you <span class="emphasis"><em>don't</em></span> have to call <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>. -</p> -<p> -</p> -<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Note</h3> -<p> -This function will terminate your program if it was unable to -initialize the windowing system for some reason. If you want -your program to fall back to a textual interface you want to -call <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a> instead. -</p> -</div> -<p> -</p> -<p> -</p> -<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Note</h3> -<p> -Since 2.18, GTK+ calls <code class="literal">signal (SIGPIPE, SIG_IGN)</code> -during initialization, to ignore SIGPIPE signals, since these are -almost never wanted in graphical applications. If you do need to -handle SIGPIPE for some reason, reset the handler after <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a>, -but notice that other libraries (e.g. libdbus or gvfs) might do -similar things. -</p> -</div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td> -<td>Address of the <em class="parameter"><code>argc</code></em> parameter of -your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if -any arguments were handled. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td> -<td>Address of the -<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options -understood by GTK+ are stripped before return. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-init-check"></a><h3>gtk_init_check ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_init_check (<em class="parameter"><code><span class="type">int</span> *argc</code></em>, - <em class="parameter"><code><span class="type">char</span> ***argv</code></em>);</pre> -<p> -This function does the same work as <a class="link" href="gtk3-General.html#gtk-init" title="gtk_init ()"><code class="function">gtk_init()</code></a> with only a single -change: It does not terminate the program if the windowing system -can't be initialized. Instead it returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> on failure. -</p> -<p> -This way the application can fall back to some other means of -communication with the user - for example a curses or command line -interface. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td> -<td>Address of the <em class="parameter"><code>argc</code></em> parameter of -your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if -any arguments were handled. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td> -<td>Address of the -<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options -understood by GTK+ are stripped before return. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the windowing system has been successfully -initialized, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-init-with-args"></a><h3>gtk_init_with_args ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_init_with_args (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *parameter_string</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntry</span></a> *entries</code></em>, - <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *translation_domain</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>);</pre> -<p> -This function does the same work as <a class="link" href="gtk3-General.html#gtk-init-check" title="gtk_init_check ()"><code class="function">gtk_init_check()</code></a>. -Additionally, it allows you to add your own commandline options, -and it automatically generates nicely formatted -<code class="option">--help</code> output. Note that your program will -be terminated after writing out the help output. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td> -<td>Address of the <em class="parameter"><code>argc</code></em> parameter of -your <code class="function">main()</code> function (or 0 if <em class="parameter"><code>argv</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). This will be changed if -any arguments were handled. <span class="annotation">[<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td> -<td>Address of the -<em class="parameter"><code>argv</code></em> parameter of <code class="function">main()</code>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Any options -understood by GTK+ are stripped before return. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc][<acronym title="Parameter for input and for returning results. Default is transfer full."><span class="acronym">inout</span></acronym>][<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>parameter_string</code></em> :</span></p></td> -<td>a string which is displayed in -the first line of <code class="option">--help</code> output, after -<code class="literal"><em class="replaceable"><code>programname</code></em> [OPTION...]</code> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td> -<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>-terminated array -of <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionEntry"><span class="type">GOptionEntrys</span></a> describing the options of your program. <span class="annotation">[<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> zero-terminated=1]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>translation_domain</code></em> :</span></p></td> -<td>a translation domain to use for translating -the <code class="option">--help</code> output for the options in <em class="parameter"><code>entries</code></em> -and the <em class="parameter"><code>parameter_string</code></em> with <code class="function">gettext()</code>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td> -<td>a return location for errors</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the windowing system has been successfully -initialized, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-option-group"></a><h3>gtk_get_option_group ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="returnvalue">GOptionGroup</span></a> * gtk_get_option_group (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> open_default_display</code></em>);</pre> -<p> -Returns a <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline arguments recognized -by GTK+ and GDK. -</p> -<p> -You should add this group to your <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionContext"><span class="type">GOptionContext</span></a> -with <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-add-group"><code class="function">g_option_context_add_group()</code></a>, if you are using -<a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#g-option-context-parse"><code class="function">g_option_context_parse()</code></a> to parse your commandline arguments. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>open_default_display</code></em> :</span></p></td> -<td>whether to open the default display -when parsing the commandline arguments</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a href="http://library.gnome.org/devel/glib/unstable/glib-Commandline-option-parser.html#GOptionGroup"><span class="type">GOptionGroup</span></a> for the commandline arguments recognized -by GTK+</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 2.6</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-events-pending"></a><h3>gtk_events_pending ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_events_pending (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Checks if any events are pending. -</p> -<p> -This can be used to update the UI and invoke timeouts etc. -while doing some time intensive computation. -</p> -<p> -</p> -<div class="example"> -<a name="id527747"></a><p class="title"><b>Example 7. Updating the UI during a long computation</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="comment">/* computation going on... */</span> - -<span class="keyword">while</span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="gtk3-General.html#gtk-events-pending">gtk_events_pending</a></span><span class="normal"> </span><span class="symbol">())</span> -<span class="normal"> </span><span class="function"><a href="gtk3-General.html#gtk-main-iteration">gtk_main_iteration</a></span><span class="normal"> </span><span class="symbol">();</span> - -<span class="comment">/* ...computation continued */</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<p><br class="example-break"> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if any events are pending, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main"></a><h3>gtk_main ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_main (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Runs the main loop until <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> is called. -</p> -<p> -You can nest calls to <a class="link" href="gtk3-General.html#gtk-main" title="gtk_main ()"><code class="function">gtk_main()</code></a>. In that case <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> -will make the innermost invocation of the main loop return. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main-level"></a><h3>gtk_main_level ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_main_level (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Asks for the current nesting level of the main loop. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the nesting level of the current invocation -of the main loop</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main-quit"></a><h3>gtk_main_quit ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_main_quit (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Makes the innermost invocation of the main loop return -when it regains control. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main-iteration"></a><h3>gtk_main_iteration ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_main_iteration (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Runs a single iteration of the mainloop. -</p> -<p> -If no events are waiting to be processed GTK+ will block -until the next event is noticed. If you don't want to block -look at <a class="link" href="gtk3-General.html#gtk-main-iteration-do" title="gtk_main_iteration_do ()"><code class="function">gtk_main_iteration_do()</code></a> or check if any events are -pending with <a class="link" href="gtk3-General.html#gtk-events-pending" title="gtk_events_pending ()"><code class="function">gtk_events_pending()</code></a> first. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the -innermost mainloop</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main-iteration-do"></a><h3>gtk_main_iteration_do ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_main_iteration_do (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> blocking</code></em>);</pre> -<p> -Runs a single iteration of the mainloop. -If no events are available either return or block depending on -the value of <em class="parameter"><code>blocking</code></em>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>blocking</code></em> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if you want GTK+ to block if no events are pending</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <a class="link" href="gtk3-General.html#gtk-main-quit" title="gtk_main_quit ()"><code class="function">gtk_main_quit()</code></a> has been called for the -innermost mainloop</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-main-do-event"></a><h3>gtk_main_do_event ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_main_do_event (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre> -<p> -Processes a single GDK event. -</p> -<p> -This is public only to allow filtering of events between GDK and GTK+. -You will not usually need to call this function directly. -</p> -<p> -While you should not call this function directly, you might want to -know how exactly events are handled. So here is what this function -does with the event: -</p> -<p> -</p> -<div class="orderedlist"><ol class="orderedlist" type="1"> -<li class="listitem"><p> - Compress enter/leave notify events. If the event passed build an - enter/leave pair together with the next event (peeked from GDK), both - events are thrown away. This is to avoid a backlog of (de-)highlighting - widgets crossed by the pointer. -</p></li> -<li class="listitem"><p> - Find the widget which got the event. If the widget can't be determined - the event is thrown away unless it belongs to a INCR transaction. In that - case it is passed to <code class="function">gtk_selection_incr_event()</code>. -</p></li> -<li class="listitem"><p> - Then the event is pushed onto a stack so you can query the currently - handled event with <a class="link" href="gtk3-General.html#gtk-get-current-event" title="gtk_get_current_event ()"><code class="function">gtk_get_current_event()</code></a>. -</p></li> -<li class="listitem"> -<p> - The event is sent to a widget. If a grab is active all events for widgets - that are not in the contained in the grab widget are sent to the latter - with a few exceptions: - </p> -<div class="itemizedlist"><ul class="itemizedlist" type="disc"> -<li class="listitem"><p> - Deletion and destruction events are still sent to the event widget for - obvious reasons. - </p></li> -<li class="listitem"><p> - Events which directly relate to the visual representation of the event - widget. - </p></li> -<li class="listitem"><p> - Leave events are delivered to the event widget if there was an enter - event delivered to it before without the paired leave event. - </p></li> -<li class="listitem"><p> - Drag events are not redirected because it is unclear what the semantics - of that would be. - </p></li> -</ul></div> -<p> - Another point of interest might be that all key events are first passed - through the key snooper functions if there are any. Read the description - of <a class="link" href="gtk3-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a> if you need this feature. -</p> -</li> -<li class="listitem"><p> - After finishing the delivery the event is popped from the event stack. -</p></li> -</ol></div> -<p> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td> -<td>An event to process (normally passed by GDK)</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="GtkModuleInitFunc"></a><h3>GtkModuleInitFunc ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> (*GtkModuleInitFunc) (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> *argc</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> ***argv</code></em>);</pre> -<p> -Each GTK+ module must have a function <code class="function">gtk_module_init()</code> -with this prototype. This function is called after loading -the module. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>argc</code></em> :</span></p></td> -<td>GTK+ always passes <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for this argument. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>argv</code></em> :</span></p></td> -<td>GTK+ always passes <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> for this argument. <span class="annotation">[<acronym title="NULL is ok, both for passing and for returning."><span class="acronym">allow-none</span></acronym>][<acronym title="Parameter points to an array of items."><span class="acronym">array</span></acronym> length=argc]</span> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="GtkModuleDisplayInitFunc"></a><h3>GtkModuleDisplayInitFunc ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> (*GtkModuleDisplayInitFunc) (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> *display</code></em>);</pre> -<p> -A multihead-aware GTK+ module may have a <code class="function">gtk_module_display_init()</code> -function with this prototype. GTK+ calls this function for each -opened display. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>display</code></em> :</span></p></td> -<td>an open <a href="http://developer.gnome.org/gdk/GdkDisplay.html"><span class="type">GdkDisplay</span></a> -</td> -</tr></tbody> -</table></div> -<p class="since">Since 2.2</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-true"></a><h3>gtk_true ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_true (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -All this function does it to return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>. -</p> -<p> -This can be useful for example if you want to inhibit the deletion -of a window. Of course you should not do this as the user expects -a reaction from clicking the close icon of the window... -</p> -<p> -</p> -<div class="example"> -<a name="id539288"></a><p class="title"><b>Example 8. A persistent window</b></p> -<div class="example-contents"> - <table class="listing_frame" border="0" cellpadding="0" cellspacing="0"> - <tbody> - <tr> - <td class="listing_lines" align="right"><pre>1 -2 -3 -4 -5 -6 -7 -8 -9 -10 -11 -12 -13 -14 -15 -16 -17 -18 -19 -20 -21 -22 -23 -24 -25 -26</pre></td> - <td class="listing_code"><pre class="programlisting"><span class="preproc">#include</span><span class="normal"> </span><span class="string"><gtk/gtk.h></span><span class="normal"><</span> - -<span class="type">int</span> -<span class="function">main</span><span class="normal"> </span><span class="symbol">(</span><span class="type">int</span><span class="normal"> argc</span><span class="symbol">,</span><span class="normal"> </span><span class="type">char</span><span class="normal"> </span><span class="symbol">**</span><span class="normal">argv</span><span class="symbol">)</span> -<span class="cbracket">{</span> -<span class="normal"> </span><span class="usertype">GtkWidget</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">*</span><span class="normal">but</span><span class="symbol">;</span> - -<span class="normal"> </span><span class="function"><a href="gtk3-General.html#gtk-init">gtk_init</a></span><span class="normal"> </span><span class="symbol">(&</span><span class="normal">argc</span><span class="symbol">,</span><span class="normal"> </span><span class="symbol">&</span><span class="normal">argv</span><span class="symbol">);</span> - -<span class="normal"> win </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkWindow.html#gtk-window-new">gtk_window_new</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk3-Standard-Enumerations.html#GTK-WINDOW-TOPLEVEL:CAPS">GTK_WINDOW_TOPLEVEL</a></span><span class="symbol">);</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"delete-event"</span><span class="symbol">,</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk3-General.html#gtk-true">gtk_true</a></span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect">g_signal_connect</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"destroy"</span><span class="symbol">,</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="gtk3-General.html#gtk-main-quit">gtk_main_quit</a></span><span class="symbol">),</span><span class="normal"> <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS">NULL</a></span><span class="symbol">);</span> - -<span class="normal"> but </span><span class="symbol">=</span><span class="normal"> </span><span class="function"><a href="GtkButton.html#gtk-button-new-with-label">gtk_button_new_with_label</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"Close yourself. I mean it!"</span><span class="symbol">);</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped">g_signal_connect_swapped</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">but</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"clicked"</span><span class="symbol">,</span> -<span class="normal"> </span><span class="function"><a href="http://library.gnome.org/devel/gobject/unstable/gobject-Closures.html#G-CALLBACK:CAPS">G_CALLBACK</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="http://library.gnome.org/devel/gtk3/GtkObject.html#gtk-object-destroy">gtk_object_destroy</a></span><span class="symbol">),</span><span class="normal"> win</span><span class="symbol">);</span> -<span class="normal"> </span><span class="function"><a href="GtkContainer.html#gtk-container-add">gtk_container_add</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function">GTK_CONTAINER</span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">),</span><span class="normal"> but</span><span class="symbol">);</span> - -<span class="normal"> </span><span class="function"><a href="GtkWidget.html#gtk-widget-show-all">gtk_widget_show_all</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">win</span><span class="symbol">);</span> - -<span class="normal"> </span><span class="function"><a href="gtk3-General.html#gtk-main">gtk_main</a></span><span class="normal"> </span><span class="symbol">();</span> - -<span class="normal"> </span><span class="keyword">return</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span> -<span class="cbracket">}</span></pre></td> - </tr> - </tbody> - </table> -</div> - -</div> -<p><br class="example-break"> -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a></td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-false"></a><h3>gtk_false ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_false (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Analogical to <a class="link" href="gtk3-General.html#gtk-true" title="gtk_true ()"><code class="function">gtk_true()</code></a>, this function does nothing -but always returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td><a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a></td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-grab-add"></a><h3>gtk_grab_add ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_grab_add (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre> -<p> -Makes <em class="parameter"><code>widget</code></em> the current grabbed widget. -</p> -<p> -This means that interaction with other widgets in the same -application is blocked and mouse as well as keyboard events -are delivered to this widget. -</p> -<p> -If <em class="parameter"><code>widget</code></em> is not sensitive, it is not set as the current -grabbed widget and this function does nothing. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td> -<td>The widget that grabs keyboard and pointer events</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-grab-get-current"></a><h3>gtk_grab_get_current ()</h3> -<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_grab_get_current (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Queries the current grab of the default window group. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>The widget which currently -has the grab or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if no grab is active. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-grab-remove"></a><h3>gtk_grab_remove ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_grab_remove (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>);</pre> -<p> -Removes the grab from the given widget. -</p> -<p> -You have to pair calls to <a class="link" href="gtk3-General.html#gtk-grab-add" title="gtk_grab_add ()"><code class="function">gtk_grab_add()</code></a> and <a class="link" href="gtk3-General.html#gtk-grab-remove" title="gtk_grab_remove ()"><code class="function">gtk_grab_remove()</code></a>. -</p> -<p> -If <em class="parameter"><code>widget</code></em> does not have the grab, this function does nothing. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td> -<td>The widget which gives up the grab</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-device-grab-add"></a><h3>gtk_device_grab_add ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_device_grab_add (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="type">gboolean</span></a> block_others</code></em>);</pre> -<p> -Adds a GTK+ grab on <em class="parameter"><code>device</code></em>, so all the events on <em class="parameter"><code>device</code></em> and its -associated pointer or keyboard (if any) are delivered to <em class="parameter"><code>widget</code></em>. -If the <em class="parameter"><code>block_others</code></em> parameter is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, any other devices will be -unable to interact with <em class="parameter"><code>widget</code></em> during the grab. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td> -<td>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td> -<td>a <span class="type">GtkDevice</span> to grab on.</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>block_others</code></em> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to prevent other devices to interact with <em class="parameter"><code>widget</code></em>.</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.0</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-device-grab-remove"></a><h3>gtk_device_grab_remove ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_device_grab_remove (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a> *device</code></em>);</pre> -<p> -Removes a device grab from the given widget. -</p> -<p> -You have to pair calls to <a class="link" href="gtk3-General.html#gtk-device-grab-add" title="gtk_device_grab_add ()"><code class="function">gtk_device_grab_add()</code></a> and -<a class="link" href="gtk3-General.html#gtk-device-grab-remove" title="gtk_device_grab_remove ()"><code class="function">gtk_device_grab_remove()</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td> -<td>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>device</code></em> :</span></p></td> -<td>a <a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a> -</td> -</tr> -</tbody> -</table></div> -<p class="since">Since 3.0</p> -</div> -<hr> -<div class="refsect2"> -<a name="GTK-PRIORITY-RESIZE:CAPS"></a><h3>GTK_PRIORITY_RESIZE</h3> -<pre class="programlisting">#define GTK_PRIORITY_RESIZE (G_PRIORITY_HIGH_IDLE + 10) -</pre> -<p> -Use this priority for functionality related to size allocation. -</p> -<p> -It is used internally by GTK+ to compute the sizes of widgets. -This priority is higher than <a href="http://developer.gnome.org/gdk/gdk3-Events.html#GDK-PRIORITY-REDRAW:CAPS"><code class="literal">GDK_PRIORITY_REDRAW</code></a> to avoid -resizing a widget which was just redrawn. -</p> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-key-snooper-install"></a><h3>gtk_key_snooper_install ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="returnvalue">guint</span></a> gtk_key_snooper_install (<em class="parameter"><code><a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> snooper</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">gtk_key_snooper_install</code> has been deprecated since version 3.4 and should not be used in newly-written code. Key snooping should not be done. Events should - be handled by widgets.</p> -</div> -<p> -Installs a key snooper function, which will get called on all -key events before delivering them normally. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>snooper</code></em> :</span></p></td> -<td>a <a class="link" href="gtk3-General.html#GtkKeySnoopFunc" title="GtkKeySnoopFunc ()"><span class="type">GtkKeySnoopFunc</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td> -<td>data to pass to <em class="parameter"><code>snooper</code></em> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a unique id for this key snooper for use with -<a class="link" href="gtk3-General.html#gtk-key-snooper-remove" title="gtk_key_snooper_remove ()"><code class="function">gtk_key_snooper_remove()</code></a>.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="GtkKeySnoopFunc"></a><h3>GtkKeySnoopFunc ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="returnvalue">gint</span></a> (*GtkKeySnoopFunc) (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *grab_widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEventKey"><span class="type">GdkEventKey</span></a> *event</code></em>, - <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> func_data</code></em>);</pre> -<p> -Key snooper functions are called before normal event delivery. -They can be used to implement custom key event handling. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>grab_widget</code></em> :</span></p></td> -<td>the widget to which the event will be delivered</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td> -<td>the key event</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>func_data</code></em> :</span></p></td> -<td>data supplied to <a class="link" href="gtk3-General.html#gtk-key-snooper-install" title="gtk_key_snooper_install ()"><code class="function">gtk_key_snooper_install()</code></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> to stop further processing of <em class="parameter"><code>event</code></em>, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> to continue.</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-key-snooper-remove"></a><h3>gtk_key_snooper_remove ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_key_snooper_remove (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> snooper_handler_id</code></em>);</pre> -<div class="warning" style="margin-left: 0.5in; margin-right: 0.5in;"> -<h3 class="title">Warning</h3> -<p><code class="literal">gtk_key_snooper_remove</code> has been deprecated since version 3.4 and should not be used in newly-written code. Key snooping should not be done. Events should - be handled by widgets.</p> -</div> -<p> -Removes the key snooper function with the given id. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><em class="parameter"><code>snooper_handler_id</code></em> :</span></p></td> -<td>Identifies the key snooper to remove</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-current-event"></a><h3>gtk_get_current_event ()</h3> -<pre class="programlisting"><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="returnvalue">GdkEvent</span></a> * gtk_get_current_event (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -Obtains a copy of the event currently being processed by GTK+. -</p> -<p> -For example, if you are handling a <a class="link" href="GtkButton.html#GtkButton-clicked" title='The "clicked" signal'><span class="type">"clicked"</span></a> signal, -the current event will be the <a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEventButton"><span class="type">GdkEventButton</span></a> that triggered -the ::clicked signal. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a copy of the current event, or -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if there is no current event. The returned event must be -freed with <a href="http://developer.gnome.org/gdk/gdk3-Events.html#gdk-event-free"><code class="function">gdk_event_free()</code></a>. <span class="annotation">[<acronym title="Free data after the code is done."><span class="acronym">transfer full</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-current-event-time"></a><h3>gtk_get_current_event_time ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint32"><span class="returnvalue">guint32</span></a> gtk_get_current_event_time (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -If there is a current event and it has a timestamp, -return that timestamp, otherwise return <a href="http://developer.gnome.org/gdk/gdk3-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the timestamp from the current event, -or <a href="http://developer.gnome.org/gdk/gdk3-Events.html#GDK-CURRENT-TIME:CAPS"><code class="literal">GDK_CURRENT_TIME</code></a>.</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-current-event-state"></a><h3>gtk_get_current_event_state ()</h3> -<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a> gtk_get_current_event_state (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Windows.html#GdkModifierType"><span class="type">GdkModifierType</span></a> *state</code></em>);</pre> -<p> -If there is a current event and it has a state field, place -that state field in <em class="parameter"><code>state</code></em> and return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a>, otherwise return -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>state</code></em> :</span></p></td> -<td>a location to store the state of the current event. <span class="annotation">[<acronym title="Parameter for returning results. Default is transfer full."><span class="acronym">out</span></acronym>]</span> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td> -<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if there was a current event and it -had a state field</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-current-event-device"></a><h3>gtk_get_current_event_device ()</h3> -<pre class="programlisting"><a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="returnvalue">GdkDevice</span></a> * gtk_get_current_event_device (<em class="parameter"><code><span class="type">void</span></code></em>);</pre> -<p> -If there is a current event and it has a device, return that -device, otherwise return <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody><tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>a <a href="http://developer.gnome.org/gdk/GdkDevice.html"><span class="type">GdkDevice</span></a>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr></tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-get-event-widget"></a><h3>gtk_get_event_widget ()</h3> -<pre class="programlisting"><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="returnvalue">GtkWidget</span></a> * gtk_get_event_widget (<em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre> -<p> -If <em class="parameter"><code>event</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> or the event was not associated with any widget, -returns <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>, otherwise returns the widget that received the event -originally. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td> -<td>a <a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td> -<td>the widget that originally -received <em class="parameter"><code>event</code></em>, or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. <span class="annotation">[<acronym title="Don't free data after the code is done."><span class="acronym">transfer none</span></acronym>]</span> -</td> -</tr> -</tbody> -</table></div> -</div> -<hr> -<div class="refsect2"> -<a name="gtk-propagate-event"></a><h3>gtk_propagate_event ()</h3> -<pre class="programlisting"><span class="returnvalue">void</span> gtk_propagate_event (<em class="parameter"><code><a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> *widget</code></em>, - <em class="parameter"><code><a href="http://developer.gnome.org/gdk/gdk3-Event-Structures.html#GdkEvent"><span class="type">GdkEvent</span></a> *event</code></em>);</pre> -<p> -Sends an event to a widget, propagating the event to parent widgets -if the event remains unhandled. -</p> -<p> -Events received by GTK+ from GDK normally begin in <a class="link" href="gtk3-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a>. -Depending on the type of event, existence of modal dialogs, grabs, etc., -the event may be propagated; if so, this function is used. -</p> -<p> -<a class="link" href="gtk3-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a> calls <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> on each widget it -decides to send the event to. So <a class="link" href="GtkWidget.html#gtk-widget-event" title="gtk_widget_event ()"><code class="function">gtk_widget_event()</code></a> is the lowest-level -function; it simply emits the <a class="link" href="GtkWidget.html#GtkWidget-event" title='The "event" signal'><span class="type">"event"</span></a> and possibly an -event-specific signal on a widget. <a class="link" href="gtk3-General.html#gtk-propagate-event" title="gtk_propagate_event ()"><code class="function">gtk_propagate_event()</code></a> is a bit -higher-level, and <a class="link" href="gtk3-General.html#gtk-main-do-event" title="gtk_main_do_event ()"><code class="function">gtk_main_do_event()</code></a> is the highest level. -</p> -<p> -All that said, you most likely don't want to use any of these -functions; synthesizing events is rarely needed. There are almost -certainly better ways to achieve your goals. For example, use -<a href="http://developer.gnome.org/gdk/gdk3-Windows.html#gdk-window-invalidate-rect"><code class="function">gdk_window_invalidate_rect()</code></a> or <a class="link" href="GtkWidget.html#gtk-widget-queue-draw" title="gtk_widget_queue_draw ()"><code class="function">gtk_widget_queue_draw()</code></a> instead -of making up expose events. -</p> -<div class="variablelist"><table border="0"> -<col align="left" valign="top"> -<tbody> -<tr> -<td><p><span class="term"><em class="parameter"><code>widget</code></em> :</span></p></td> -<td>a <a class="link" href="GtkWidget.html" title="GtkWidget"><span class="type">GtkWidget</span></a> -</td> -</tr> -<tr> -<td><p><span class="term"><em class="parameter"><code>event</code></em> :</span></p></td> -<td>an event</td> -</tr> -</tbody> -</table></div> -</div> -</div> -<div class="refsect1"> -<a name="gtk3-General.see-also"></a><h2>See Also</h2> -See the GLib manual, especially <a href="http://library.gnome.org/devel/glib/unstable/glib-The-Main-Event-Loop.html#GMainLoop"><span class="type">GMainLoop</span></a> and signal-related - functions such as <a href="http://library.gnome.org/devel/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a> -</div> -</div> -<div class="footer"> -<hr> - Generated by GTK-Doc V1.18.1</div> -</body> -</html>
\ No newline at end of file |