summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2011-12-02 10:32:10 -0500
committerRyan Lortie <desrt@desrt.ca>2011-12-19 12:51:10 -0500
commit59092e1c00b888eccfbb860b46c4ff6e5cf470b0 (patch)
tree369704a53dacc5cd14e8e6806727deeef791c9d7 /examples
parent2e64177e3f48cce54b165db36e07a0f7caaacee3 (diff)
downloadgtk+-59092e1c00b888eccfbb860b46c4ff6e5cf470b0.tar.gz
bloatpad: port to GActionMap for application
g_application_set_action_group() is now deprecated.
Diffstat (limited to 'examples')
-rw-r--r--examples/bloatpad.c20
1 files changed, 2 insertions, 18 deletions
diff --git a/examples/bloatpad.c b/examples/bloatpad.c
index f107a07c79..0998eb3901 100644
--- a/examples/bloatpad.c
+++ b/examples/bloatpad.c
@@ -142,9 +142,7 @@ show_about (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
{
- GtkWindow *window = user_data;
-
- gtk_show_about_dialog (window,
+ gtk_show_about_dialog (NULL,
"program-name", "Bloatpad",
"title", "About Bloatpad",
"comments", "Not much to say, really.",
@@ -179,26 +177,12 @@ static GActionEntry app_entries[] = {
{ "quit", quit_app, NULL, NULL, NULL },
};
-static GActionGroup *
-create_app_actions (void)
-{
- GSimpleActionGroup *actions = g_simple_action_group_new ();
- g_simple_action_group_add_entries (actions,
- app_entries, G_N_ELEMENTS (app_entries),
- NULL);
-
- return G_ACTION_GROUP (actions);
-}
-
static void
bloat_pad_init (BloatPad *app)
{
- GActionGroup *actions;
GtkBuilder *builder;
- actions = create_app_actions ();
- g_application_set_action_group (G_APPLICATION (app), actions);
- g_object_unref (actions);
+ g_action_map_add_action_entries (G_ACTION_MAP (app), app_entries, G_N_ELEMENTS (app_entries), app);
builder = gtk_builder_new ();
gtk_builder_add_from_string (builder,