forked from AuroraMiddleware/gtk
Add the new exampleapp to the docs
This commit is contained in:
parent
7265d9d9ad
commit
055e4722f5
@ -421,6 +421,7 @@ HTML_IMAGES = \
|
|||||||
$(srcdir)/images/getting-started-app7.png \
|
$(srcdir)/images/getting-started-app7.png \
|
||||||
$(srcdir)/images/getting-started-app8.png \
|
$(srcdir)/images/getting-started-app8.png \
|
||||||
$(srcdir)/images/getting-started-app9.png \
|
$(srcdir)/images/getting-started-app9.png \
|
||||||
|
$(srcdir)/images/getting-started-app10.png \
|
||||||
$(srcdir)/images/exampleapp.png \
|
$(srcdir)/images/exampleapp.png \
|
||||||
$(srcdir)/images/flow-box.png
|
$(srcdir)/images/flow-box.png
|
||||||
|
|
||||||
|
@ -959,7 +959,7 @@ example_app_window_init (ExampleAppWindow *win)
|
|||||||
<ulink url="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c">full source</ulink>
|
<ulink url="https://git.gnome.org/browse/gtk+/tree/examples/application9/exampleappwin.c">full source</ulink>
|
||||||
if you are interested in the details.</para>
|
if you are interested in the details.</para>
|
||||||
|
|
||||||
<para>This brings our example application to its final appearance:</para>
|
<para>This brings our example application to this appearance:</para>
|
||||||
|
|
||||||
<informalfigure>
|
<informalfigure>
|
||||||
<mediaobject>
|
<mediaobject>
|
||||||
@ -969,5 +969,35 @@ example_app_window_init (ExampleAppWindow *win)
|
|||||||
</mediaobject>
|
</mediaobject>
|
||||||
</informalfigure>
|
</informalfigure>
|
||||||
</section>
|
</section>
|
||||||
|
<section>
|
||||||
|
<title>Header bar</title>
|
||||||
|
|
||||||
|
<para>Our application already uses a GtkHeaderBar, but so far it
|
||||||
|
still gets a 'normal' window titlebar on top of that. This is a
|
||||||
|
bit redundant, and we will now tell GTK+ to use the header bar
|
||||||
|
as replacement for the titlebar. To do so, we move it around to
|
||||||
|
be a direct child of the window, and set its type to be titlebar.</para>
|
||||||
|
|
||||||
|
<informalexample>
|
||||||
|
<programlisting><xi:include href="../../../../examples/application10/window.ui" parse="text"><xi:fallback>FIXME: MISSING XINCLUDE CONTENT</xi:fallback></xi:include></programlisting>
|
||||||
|
</informalexample>
|
||||||
|
|
||||||
|
<para>A small extra refinement that we have added here is to allow
|
||||||
|
the header bar to provide a fallback application menu, by setting
|
||||||
|
the show-fallback-app-menu property to TRUE. Here is how the
|
||||||
|
application now looks, if this fallback is used.</para>
|
||||||
|
|
||||||
|
<informalfigure>
|
||||||
|
<mediaobject>
|
||||||
|
<imageobject>
|
||||||
|
<imagedata fileref="getting-started-app10.png" format="PNG"/>
|
||||||
|
</imageobject>
|
||||||
|
</mediaobject>
|
||||||
|
</informalfigure>
|
||||||
|
|
||||||
|
<para>If we set up the window icon for our window, the menu button
|
||||||
|
will use that instead of the generic placeholder icon you see
|
||||||
|
here.
|
||||||
|
</section>
|
||||||
</section>
|
</section>
|
||||||
</chapter>
|
</chapter>
|
||||||
|
BIN
docs/reference/gtk/images/getting-started-app10.png
Normal file
BIN
docs/reference/gtk/images/getting-started-app10.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 100 KiB |
@ -241,7 +241,6 @@ example_app_window_init (ExampleAppWindow *win)
|
|||||||
priv->lines_label, "visible",
|
priv->lines_label, "visible",
|
||||||
G_BINDING_DEFAULT);
|
G_BINDING_DEFAULT);
|
||||||
|
|
||||||
gtk_window_set_icon_name (GTK_WINDOW (win), "sunny");
|
|
||||||
g_object_set (gtk_settings_get_default (), "gtk-shell-shows-app-menu", FALSE, NULL);
|
g_object_set (gtk_settings_get_default (), "gtk-shell-shows-app-menu", FALSE, NULL);
|
||||||
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (win), TRUE);
|
gtk_application_window_set_show_menubar (GTK_APPLICATION_WINDOW (win), TRUE);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user