Commit 542aedc1 authored by Tor Lillqvist's avatar Tor Lillqvist Committed by Tor Lillqvist
Browse files

Position the dialog with GTK_WIN_POS_CENTER. (do_quit): New function, hide

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().
parent a9340696
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
......
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
......
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment