diff options
author | Matthias Clasen <mclasen@redhat.com> | 2016-02-27 23:43:06 -0500 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2016-02-27 23:43:06 -0500 |
commit | 492fec62949019c8344c872e51b8bd0516948bba (patch) | |
tree | dd9f1cfd8ca877b79142bd3fe2be5b7bceaaa777 /demos | |
parent | 9d5ad67c91c76b71b31342f53c04f56c93773b35 (diff) | |
download | gtk+-492fec62949019c8344c872e51b8bd0516948bba.tar.gz |
gtk-demo: Put hte app menu in a separate file
No need to cram it in the same file as the main window.
Diffstat (limited to 'demos')
-rw-r--r-- | demos/gtk-demo/appmenu.ui | 19 | ||||
-rw-r--r-- | demos/gtk-demo/demo.gresource.xml | 1 | ||||
-rw-r--r-- | demos/gtk-demo/main.c | 2 | ||||
-rw-r--r-- | demos/gtk-demo/main.ui | 15 |
4 files changed, 21 insertions, 16 deletions
diff --git a/demos/gtk-demo/appmenu.ui b/demos/gtk-demo/appmenu.ui new file mode 100644 index 0000000000..d52693bac7 --- /dev/null +++ b/demos/gtk-demo/appmenu.ui @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<interface> + <!-- interface-requires gtk+ 3.10 --> + <menu id="appmenu"> + <section> + <item> + <attribute name="label" translatable="yes">About</attribute> + <attribute name="action">app.about</attribute> + </item> + </section> + <section> + <item> + <attribute name="label" translatable="yes">_Quit</attribute> + <attribute name="action">app.quit</attribute> + <attribute name="accel"><Primary>q</attribute> + </item> + </section> + </menu> +</interface> diff --git a/demos/gtk-demo/demo.gresource.xml b/demos/gtk-demo/demo.gresource.xml index b1026498e5..ea8786363f 100644 --- a/demos/gtk-demo/demo.gresource.xml +++ b/demos/gtk-demo/demo.gresource.xml @@ -2,6 +2,7 @@ <gresources> <gresource prefix="/ui"> <file preprocess="xml-stripblanks">main.ui</file> + <file preprocess="xml-stripblanks">appmenu.ui</file> </gresource> <gresource prefix="/application_demo"> <file>application.c</file> diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c index 41202feefb..3d21832e37 100644 --- a/demos/gtk-demo/main.c +++ b/demos/gtk-demo/main.c @@ -920,7 +920,7 @@ startup (GApplication *app) gchar *ids[] = { "appmenu", NULL }; builder = gtk_builder_new (); - gtk_builder_add_objects_from_resource (builder, "/ui/main.ui", ids, NULL); + gtk_builder_add_objects_from_resource (builder, "/ui/appmenu.ui", ids, NULL); appmenu = (GMenuModel *)gtk_builder_get_object (builder, "appmenu"); diff --git a/demos/gtk-demo/main.ui b/demos/gtk-demo/main.ui index 4e06bbdbe9..67a1ae11ec 100644 --- a/demos/gtk-demo/main.ui +++ b/demos/gtk-demo/main.ui @@ -1,21 +1,6 @@ <?xml version="1.0" encoding="UTF-8"?> <interface> <!-- interface-requires gtk+ 3.10 --> - <menu id="appmenu"> - <section> - <item> - <attribute name="label" translatable="yes">About</attribute> - <attribute name="action">app.about</attribute> - </item> - </section> - <section> - <item> - <attribute name="label" translatable="yes">_Quit</attribute> - <attribute name="action">app.quit</attribute> - <attribute name="accel"><Primary>q</attribute> - </item> - </section> - </menu> <object class="GtkTreeStore" id="treestore"> <columns> <!-- column-name NAME --> |