New upstream version 3.22.30
This commit is contained in:
@ -467,12 +467,12 @@ example_app_window_class_init (ExampleAppWindowClass *class)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application2/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application2/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>You may have noticed that we used the <code class="literal">_from_resource()</code> variant
|
||||
of the function that sets a template. Now we need to use GLib's resource
|
||||
functionality to include the ui file in the binary. This is commonly
|
||||
done by listing all resources in a .gresource.xml file, such as this:
|
||||
of the function that sets a template. Now we need to use <a class="ulink" href="https://developer.gnome.org/gio/stable/GResource.html" target="_top">GLib's resource functionality</a>
|
||||
to include the ui file in the binary. This is commonly done by listing
|
||||
all resources in a .gresource.xml file, such as this:
|
||||
</p>
|
||||
<div class="informalexample">
|
||||
<table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
|
||||
@ -538,7 +538,7 @@ example_app_window_class_init (ExampleAppWindowClass *class)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application3/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application3/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>Now we revisit the <code class="function">example_app_window_open()</code> function that
|
||||
is called for each commandline argument, and construct a GtkTextView
|
||||
@ -585,7 +585,7 @@ example_app_window_open (ExampleAppWindow *win,
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application3/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application3/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>Note that we did not have to touch the stack switcher
|
||||
at all. It gets all its information from the stack that it
|
||||
@ -711,7 +711,7 @@ example_app_class_init (ExampleAppClass *class)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application4/exampleapp.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application4/exampleapp.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>Our preferences menu item does not do anything yet,
|
||||
but the Quit menu item is fully functional. Note that it
|
||||
@ -808,7 +808,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application5/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application5/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>The code to connect the font setting is a little more involved,
|
||||
since there is no simple object property that it corresponds to, so
|
||||
@ -1133,7 +1133,7 @@ preferences_activated (GSimpleAction *action,
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application6/exampleapp.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application6/exampleapp.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>After all this work, our application can now show
|
||||
a preference dialog like this:</p>
|
||||
@ -1336,7 +1336,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application7/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application7/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>With the search bar, our application now looks like this:</p>
|
||||
<div class="informalfigure"><div class="mediaobject"><img src="getting-started-app7.png"></div></div>
|
||||
@ -1615,7 +1615,7 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application8/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application8/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>What our application looks like now:</p>
|
||||
<div class="informalfigure"><div class="mediaobject"><img src="getting-started-app8.png"></div></div>
|
||||
@ -1701,11 +1701,11 @@ example_app_window_init (ExampleAppWindow *win)
|
||||
|
||||
...
|
||||
</pre>
|
||||
<p>(<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
<p>(<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application9/exampleappwin.c" target="_top">full source</a>)</p>
|
||||
</div>
|
||||
<p>We also need a function that counts the lines of the currently
|
||||
active tab, and updates the <em class="parameter"><code>lines</code></em> label. See the
|
||||
<a class="ulink" href="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c" target="_top">full source</a>
|
||||
<a class="ulink" href="https://gitlab.gnome.org/GNOME/gtk/blob/gtk-3-22/examples/application9/exampleappwin.c" target="_top">full source</a>
|
||||
if you are interested in the details.</p>
|
||||
<p>This brings our example application to this appearance:</p>
|
||||
<div class="informalfigure"><div class="mediaobject"><img src="getting-started-app9.png"></div></div>
|
||||
|
||||
Reference in New Issue
Block a user