diff --git a/demos/gtk-demo/Makefile.am b/demos/gtk-demo/Makefile.am index 4b38fe6689..db62767b71 100644 --- a/demos/gtk-demo/Makefile.am +++ b/demos/gtk-demo/Makefile.am @@ -77,7 +77,13 @@ EXTRA_DIST += \ application.ui \ menus.ui \ gtk-logo-24.png \ - gtk-logo-48.png + gtk-logo-48.png \ + org.gtk.Demo.gschema.xml + +gsettings_SCHEMAS = \ + org.gtk.Demo.gschema.xml + +@GSETTINGS_RULES@ demos.h: @REBUILD@ $(demos) geninclude.pl $(AM_V_GEN) (here=`pwd` ; cd $(srcdir) && $(PERL) $$here/geninclude.pl $(demos)) > demos.h diff --git a/demos/gtk-demo/application.c b/demos/gtk-demo/application.c index 27c70e29a9..95d4be9581 100644 --- a/demos/gtk-demo/application.c +++ b/demos/gtk-demo/application.c @@ -280,7 +280,6 @@ static GActionEntry app_entries[] = { static GActionEntry win_entries[] = { { "titlebar", activate_toggle, NULL, "false", change_titlebar_state }, - { "color", activate_radio, "s", "'red'", change_radio_state }, { "shape", activate_radio, "s", "'oval'", change_radio_state }, { "bold", activate_toggle, NULL, "false", NULL }, { "about", activate_about, NULL, NULL, NULL }, @@ -370,17 +369,24 @@ int main (int argc, char *argv[]) { GtkApplication *app; + GSettings *settings; + GAction *action; gtk_init (NULL, NULL); register_stock_icons (); app = gtk_application_new ("org.gtk.Demo", 0); + settings = g_settings_new ("org.gtk.Demo"); g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app); + action = g_settings_create_action (settings, "color"); + + g_action_map_add_action (G_ACTION_MAP (app), action); + g_signal_connect (app, "startup", G_CALLBACK (startup), NULL); g_signal_connect (app, "activate", G_CALLBACK (activate), NULL); diff --git a/demos/gtk-demo/menus.ui b/demos/gtk-demo/menus.ui index 410596b036..2f1e105f6b 100644 --- a/demos/gtk-demo/menus.ui +++ b/demos/gtk-demo/menus.ui @@ -18,9 +18,9 @@
- - - + + +
diff --git a/demos/gtk-demo/org.gtk.Demo.gschema.xml b/demos/gtk-demo/org.gtk.Demo.gschema.xml new file mode 100644 index 0000000000..33e12aaa4a --- /dev/null +++ b/demos/gtk-demo/org.gtk.Demo.gschema.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + 'red' + + + +