diff console/libgnt/gntwidget.c @ 14613:62bb53609a36

[gaim-migrate @ 17341] Menus and windows. I have added a test-app test/menu.c to show how to use it. Pressing Ctrl+o brings up the menu for the window (if it has one). It should now be possible to add menus for account-actions and all that stuff. Patches are very welcome. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 24 Sep 2006 07:14:26 +0000
parents 3ac156db9cb6
children 8a0cfee11af8
line wrap: on
line diff
--- a/console/libgnt/gntwidget.c	Sat Sep 23 19:04:03 2006 +0000
+++ b/console/libgnt/gntwidget.c	Sun Sep 24 07:14:26 2006 +0000
@@ -9,6 +9,7 @@
 {
 	SIG_DESTROY,
 	SIG_DRAW,
+	SIG_HIDE,
 	SIG_GIVE_FOCUS,
 	SIG_LOST_FOCUS,
 	SIG_KEY_PRESSED,
@@ -167,6 +168,14 @@
 					 NULL, NULL,
 					 g_cclosure_marshal_VOID__VOID,
 					 G_TYPE_NONE, 0);
+	signals[SIG_HIDE] = 
+		g_signal_new("hide",
+					 G_TYPE_FROM_CLASS(klass),
+					 G_SIGNAL_RUN_LAST,
+					 G_STRUCT_OFFSET(GntWidgetClass, hide),
+					 NULL, NULL,
+					 g_cclosure_marshal_VOID__VOID,
+					 G_TYPE_NONE, 0);
 	signals[SIG_EXPOSE] = 
 		g_signal_new("expose",
 					 G_TYPE_FROM_CLASS(klass),
@@ -403,6 +412,7 @@
 void
 gnt_widget_hide(GntWidget *widget)
 {
+	g_signal_emit(widget, signals[SIG_HIDE], 0);
 	wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL));
 #if 0
 	/* XXX: I have no clue why, but this seemed to be necessary. */