[gtk+] bloatpad: Add a close button to the accel dialog



commit 2ddbca7ba503860911092f46633035da2345938d
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jul 19 19:42:56 2014 -0400

    bloatpad: Add a close button to the accel dialog

 examples/bp/bloatpad.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/examples/bp/bloatpad.c b/examples/bp/bloatpad.c
index 8e71efb..01a6998 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);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]