]> Pileus Git - ~andy/gtk/commitdiff
Add the possibility to test what happens if the process just calls exit()
authorTor Lillqvist <tml@novell.com>
Mon, 10 Mar 2008 19:28:34 +0000 (19:28 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Mon, 10 Mar 2008 19:28:34 +0000 (19:28 +0000)
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+.

svn path=/trunk/; revision=19745

ChangeLog
tests/teststatusicon.c

index 4660515d58514a1af60300973823696f8a84f21f..d473ccf3d24b20e854693b6379b26441707de30d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,12 @@
 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+.
+
+2008-03-10  Tor Lillqvist  <tml@novell.com>
+
+
        * gtk/gtktrayicon-win32.c: Remove from SVN, finally.
 
 2008-03-10  Tor Lillqvist  <tml@novell.com>
index 9fe9c99c5dc601b8d8e28c0943cc857ed0bd0fb4..86473601f89381bf6b119bb4f84c14eac40e909b 100755 (executable)
@@ -22,6 +22,8 @@
  */
 
 #include <gtk/gtk.h>
+#include <stdlib.h>
+
 #include "prop-editor.h"
 
 typedef enum
@@ -256,6 +258,12 @@ do_quit (GtkMenuItem *item)
   gtk_main_quit ();
 }
 
+static void
+do_exit (GtkMenuItem *item)
+{
+  exit (0);
+}
+
 static void 
 popup_menu (GtkStatusIcon *icon,
            guint          button,
@@ -291,6 +299,13 @@ popup_menu (GtkStatusIcon *icon,
 
   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,