summaryrefslogtreecommitdiff
path: root/examples/bp
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-07-19 19:42:56 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-07-19 19:42:56 -0400
commit2ddbca7ba503860911092f46633035da2345938d (patch)
treeac0e0fcdbda0de9452982024cea917e3341d7eee /examples/bp
parent70e898bc90d52326578707cf0d9e1f01b65f7729 (diff)
downloadgtk+-2ddbca7ba503860911092f46633035da2345938d.tar.gz
bloatpad: Add a close button to the accel dialog
Diffstat (limited to 'examples/bp')
-rw-r--r--examples/bp/bloatpad.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c
index 8e71efb948..01a699842e 100644
--- a/examples/bp/bloatpad.c
+++ b/examples/bp/bloatpad.c
@@ -383,6 +383,12 @@ response (GtkDialog *dialog,
const gchar *str;
gchar **accels;
+ if (response_id == GTK_RESPONSE_CLOSE)
+ {
+ gtk_widget_destroy (GTK_WIDGET (dialog));
+ return;
+ }
+
action = gtk_combo_box_get_active_id (combo);
if (!action)
@@ -417,6 +423,7 @@ edit_accels (GSimpleAction *action,
g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), dialog);
entry = gtk_entry_new ();
gtk_container_add (GTK_CONTAINER (gtk_dialog_get_content_area (GTK_DIALOG (dialog))), entry);
+ gtk_dialog_add_button (GTK_DIALOG (dialog), "Close", GTK_RESPONSE_CLOSE);
gtk_dialog_add_button (GTK_DIALOG (dialog), "Set", GTK_RESPONSE_APPLY);
g_signal_connect (dialog, "response", G_CALLBACK (response), dialog);
g_object_set_data (G_OBJECT (dialog), "combo", combo);