gtk+ r19745 - in trunk: . tests



Author: tml
Date: Mon Mar 10 19:28:34 2008
New Revision: 19745
URL: http://svn.gnome.org/viewvc/gtk+?rev=19745&view=rev

Log:
2008-03-10  Tor Lillqvist  <tml novell com>

	* tests/teststatusicon.c (do_exit, popup_menu): Add the
	possibility to test what happens if the process just calls exit()
	without any orderly cleanup of GTK+.



Modified:
   trunk/ChangeLog
   trunk/tests/teststatusicon.c

Modified: trunk/tests/teststatusicon.c
==============================================================================
--- trunk/tests/teststatusicon.c	(original)
+++ trunk/tests/teststatusicon.c	Mon Mar 10 19:28:34 2008
@@ -22,6 +22,8 @@
  */
 
 #include <gtk/gtk.h>
+#include <stdlib.h>
+
 #include "prop-editor.h"
 
 typedef enum
@@ -256,6 +258,12 @@
   gtk_main_quit ();
 }
 
+static void
+do_exit (GtkMenuItem *item)
+{
+  exit (0);
+}
+
 static void 
 popup_menu (GtkStatusIcon *icon,
 	    guint          button,
@@ -291,6 +299,13 @@
 
   gtk_widget_show (menuitem);
 
+  menuitem = gtk_menu_item_new_with_label ("Exit abruptly");
+  g_signal_connect (menuitem, "activate", G_CALLBACK (do_exit), NULL);
+
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+  gtk_widget_show (menuitem);
+
   gtk_menu_popup (GTK_MENU (menu), 
 		  NULL, NULL,
 		  gtk_status_icon_position_menu, icon,



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