[gnome-bluetooth/fedora-11] Handle delete-event in test-plugins



commit eb1d160df6df18e40e096e0a340bc097603f2071
Author: Bastien Nocera <hadess hadess net>
Date:   Mon Aug 10 11:20:37 2009 +0100

    Handle delete-event in test-plugins
    
    So we can have it exit cleanly for use with valgrind.

 lib/test-plugins.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/lib/test-plugins.c b/lib/test-plugins.c
index ce4009b..ac06084 100644
--- a/lib/test-plugins.c
+++ b/lib/test-plugins.c
@@ -2,6 +2,15 @@
 #include <dbus/dbus-glib.h>
 #include "bluetooth-plugin-manager.h"
 
+static gboolean
+delete_event_cb (GtkWidget *widget,
+		 GdkEvent  *event,
+		 gpointer   user_data)
+{
+	gtk_main_quit ();
+	return FALSE;
+}
+
 int main (int argc, char **argv)
 {
 	GtkWidget *window, *vbox;
@@ -18,6 +27,8 @@ int main (int argc, char **argv)
 	bluetooth_plugin_manager_init ();
 
 	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
+	g_signal_connect (G_OBJECT (window), "delete-event",
+			  G_CALLBACK (delete_event_cb), NULL);
 	vbox = gtk_vbox_new (FALSE, 6);
 	gtk_container_add (GTK_CONTAINER (window), vbox);
 



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