New upstream version 3.24.0

This commit is contained in:
Iain Lane
2018-09-04 17:26:14 +01:00
538 changed files with 55578 additions and 33249 deletions

View File

@ -134,7 +134,7 @@ main (int argc,
is connected to the <code class="function">activate()</code> function above the <code class="function">main()</code> functions.
The <code class="varname">activate</code> signal will be sent
when your application is launched with
<code class="function">g_application_run()</code> on the line below.
<a href="https://developer.gnome.org/gio/unstable/GApplication.html#g-application-run"><code class="function">g_application_run()</code></a> on the line below.
The <code class="function">gtk_application_run()</code> also takes as arguments the pointers to the command line arguments
counter and string array; this allows GTK+ to parse specific command line
arguments that control the behavior of GTK+ itself. The parsed arguments
@ -166,9 +166,9 @@ main (int argc,
<p>Finally the window size is set using gtk_window_set_default_size and
the window is then shown by GTK via <a class="link" href="GtkWidget.html#gtk-widget-show-all" title="gtk_widget_show_all ()"><code class="function">gtk_widget_show_all()</code></a>.</p>
<p>When you exit the window, by for example pressing the X,
the <code class="function">g_application_run()</code> in the main loop returns with a number
the <a href="https://developer.gnome.org/gio/unstable/GApplication.html#g-application-run"><code class="function">g_application_run()</code></a> in the main loop returns with a number
which is saved inside an integer named "status". Afterwards, the
<a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> object is freed from memory with <code class="function">g_object_unref()</code>.
<a class="link" href="GtkApplication.html" title="GtkApplication"><span class="type">GtkApplication</span></a> object is freed from memory with <a href="https://developer.gnome.org/gobject/unstable/gobject-The-Base-Object-Type.html#g-object-unref"><code class="function">g_object_unref()</code></a>.
Finally the status integer is returned and the GTK application exits.</p>
<p>While the program is running, GTK+ is receiving
<em class="firstterm">events</em>. These are typically input events caused by
@ -262,17 +262,17 @@ main (int argc,
Using g_signal_connect the button is connected to a function in our app called
<code class="function">print_hello()</code>, so that when the button is clicked, GTK will call this function.
As the <code class="function">print_hello()</code> function does not use any data as input, NULL is passed
to it. <code class="function">print_hello()</code> calls <code class="function">g_print()</code> with the string "Hello World"
to it. <code class="function">print_hello()</code> calls <a href="https://developer.gnome.org/glib/unstable/glib-Warnings-and-Assertions.html#g-print"><code class="function">g_print()</code></a> with the string "Hello World"
which will print Hello World in a terminal if the GTK application was started
from one.</p>
<p>After connecting <code class="function">print_hello()</code>, another signal is connected to the "clicked" state
of the button using <code class="function">g_signal_connect_swapped()</code>. This functions is similar to
a <code class="function">g_signal_connect()</code> with the difference lying in how the callback function is
treated. <code class="function">g_signal_connect_swapped()</code> allow you to specify what the callback
of the button using <a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped"><code class="function">g_signal_connect_swapped()</code></a>. This functions is similar to
a <a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a> with the difference lying in how the callback function is
treated. <a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect-swapped"><code class="function">g_signal_connect_swapped()</code></a> allow you to specify what the callback
function should take as parameter by letting you pass it as data. In this case
the function being called back is <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a> and the <code class="varname">window</code>
pointer is passed to it. This has the effect that when the button is clicked,
the whole GTK window is destroyed. In contrast if a normal <code class="function">g_signal_connect()</code> were used
the whole GTK window is destroyed. In contrast if a normal <a href="https://developer.gnome.org/gobject/unstable/gobject-Signals.html#g-signal-connect"><code class="function">g_signal_connect()</code></a> were used
to connect the "clicked" signal with <a class="link" href="GtkWidget.html#gtk-widget-destroy" title="gtk_widget_destroy ()"><code class="function">gtk_widget_destroy()</code></a>, then the <code class="varname">button</code>
itself would have been destroyed, not the window.
More information about creating buttons can be found