diff console/libgnt/gntwidget.c @ 13907:cc60d0861337

[gaim-migrate @ 16402] This commit has 1234 lines of diff :) Windows can now be moved (alt+m, then the arrow keys, then escape/enter). Add a window to enable/disable accounts. But the 'add' etc. buttons don't have any callbacks yet. I am going to need to do some more widgets (checkbox, combobox) before I do anything else. I have also updated the test programs to work with the changes in libgnt. committer: Tailor Script <tailor@pidgin.im>
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Sun, 02 Jul 2006 22:13:06 +0000
parents a621329e8c85
children fdf2dbed6faa
line wrap: on
line diff
--- a/console/libgnt/gntwidget.c	Sun Jul 02 21:52:06 2006 +0000
+++ b/console/libgnt/gntwidget.c	Sun Jul 02 22:13:06 2006 +0000
@@ -239,11 +239,11 @@
 gnt_widget_show(GntWidget *widget)
 {
 	/* Draw the widget and take focus */
-	gnt_widget_draw(widget);
 	if (GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_CAN_TAKE_FOCUS)
 	{
 		gnt_widget_take_focus(widget);
 	}
+	gnt_widget_draw(widget);
 }
 
 void
@@ -267,7 +267,7 @@
 		widget->window = newwin(widget->priv.height, widget->priv.width,
 						widget->priv.y, widget->priv.x);
 		wbkgd(widget->window, COLOR_PAIR(GNT_COLOR_NORMAL));
-	
+
 		if (!(GNT_WIDGET_FLAGS(widget) & GNT_WIDGET_NO_BORDER))
 			box(widget->window, 0, 0);
 		else
@@ -316,8 +316,8 @@
 gnt_widget_hide(GntWidget *widget)
 {
 	wbkgdset(widget->window, '\0' | COLOR_PAIR(GNT_COLOR_NORMAL));
-	werase(widget->window);
 	gnt_screen_release(widget);
+	GNT_WIDGET_UNSET_FLAGS(widget, GNT_WIDGET_MAPPED);
 }
 
 void
@@ -326,6 +326,8 @@
 	/* XXX: Need to install properties for these and g_object_notify */
 	wid->priv.x = x;
 	wid->priv.y = y;
+	if (wid->window)
+		mvwin(wid->window, y, x);
 	g_signal_emit(wid, signals[SIG_POSITION], 0, x, y);
 }