]> Pileus Git - ~andy/gtk/commitdiff
Position the dialog with GTK_WIN_POS_CENTER. (do_quit): New function, hide
authorTor Lillqvist <tml@novell.com>
Thu, 3 Nov 2005 12:09:49 +0000 (12:09 +0000)
committerTor Lillqvist <tml@src.gnome.org>
Thu, 3 Nov 2005 12:09:49 +0000 (12:09 +0000)
2005-11-03  Tor Lillqvist  <tml@novell.com>

* tests/teststatusicon.c (icon_activated): Position the dialog
with GTK_WIN_POS_CENTER.
(do_quit): New function, hide and unref the GtkStatusIcon, and
call gtk_main_quit().
(popup_menu): Add a Quit menu item that calls do_quit().

ChangeLog
ChangeLog.pre-2-10
tests/teststatusicon.c

index e60fb04b9c28a7b73410a4284d5084e7b9326d6d..21f1d156d8aedf38aa6762a5a79afe770a6434ec 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2005-11-03  Tor Lillqvist  <tml@novell.com>
+
+       * tests/teststatusicon.c (icon_activated): Position the dialog
+       with GTK_WIN_POS_CENTER.
+       (do_quit): New function, hide and unref the GtkStatusIcon, and
+       call gtk_main_quit().
+       (popup_menu): Add a Quit menu item that calls do_quit().
+       
 2005-11-02  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkcolor-win32.c
index e60fb04b9c28a7b73410a4284d5084e7b9326d6d..21f1d156d8aedf38aa6762a5a79afe770a6434ec 100644 (file)
@@ -1,3 +1,11 @@
+2005-11-03  Tor Lillqvist  <tml@novell.com>
+
+       * tests/teststatusicon.c (icon_activated): Position the dialog
+       with GTK_WIN_POS_CENTER.
+       (do_quit): New function, hide and unref the GtkStatusIcon, and
+       call gtk_main_quit().
+       (popup_menu): Add a Quit menu item that calls do_quit().
+       
 2005-11-02  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkcolor-win32.c
index 738181d30d983cdf7538a9e6dd6b45d22d3e0f97..102eb3390d9b404d95c7b160377282f88ba8591d 100755 (executable)
@@ -113,6 +113,8 @@ icon_activated (GtkStatusIcon *icon)
                                       GTK_BUTTONS_CLOSE,
                                       "You wanna test the status icon ?");
 
+      gtk_window_set_position (dialog, GTK_WIN_POS_CENTER);
+
       g_object_set_data_full (G_OBJECT (icon), "test-status-icon-dialog",
                              dialog, (GDestroyNotify) gtk_widget_destroy);
 
@@ -160,6 +162,15 @@ check_activated (GtkCheckMenuItem *item,
                                gtk_check_menu_item_get_active (item));
 }
 
+static void
+do_quit (GtkMenuItem   *item,
+        GtkStatusIcon *icon)
+{
+  gtk_status_icon_set_visible (icon, FALSE);
+  g_object_unref (icon);
+  gtk_main_quit ();
+}
+
 static void 
 popup_menu (GtkStatusIcon *icon,
            guint          button,
@@ -178,6 +189,13 @@ popup_menu (GtkStatusIcon *icon,
 
   gtk_widget_show (menuitem);
 
+  menuitem = gtk_menu_item_new_with_label ("Quit");
+  g_signal_connect (menuitem, "activate", G_CALLBACK (do_quit), icon);
+
+  gtk_menu_shell_append (GTK_MENU_SHELL (menu), menuitem);
+
+  gtk_widget_show (menuitem);
+
   gtk_menu_popup (GTK_MENU (menu), 
                  NULL, NULL, NULL, NULL, 
                  button, activate_time);