Fixed a major flaw in the GTK+ implementation I only realized now: by calling gtk_widget_show_all() in uiWindowShow(), we override the user's explicit hide settings! Fix it by calling gtk_widget_show() there (to only show the window), and gtk_widget_show_all() in both the new control constructor (to show the new control initially) and in the container constructor (to show that initially too).

This commit is contained in:
Pietro Gagliardi 2015-04-12 00:59:32 -04:00
parent 5f3eb6fbfa
commit 8f6acdc8da
4 changed files with 12 additions and 2 deletions

View File

@ -7,6 +7,7 @@
- GWL(P)_ID
- make sure all terminology is consistent
- 32-bit Mac OS X support (requires lots of code changes)
- add a test for hidden controls when a window is shown
ultimately:
- make everything vtable-based

View File

@ -117,7 +117,12 @@ static void uiContainer_class_init(uiContainerClass *class)
GtkWidget *newContainer(void)
{
return GTK_WIDGET(g_object_new(uiContainerType, NULL));
GtkWidget *w;
w = GTK_WIDGET(g_object_new(uiContainerType, NULL));
// call gtk_widget_show_all() here to make the container visible
gtk_widget_show_all(w);
return w;
}
void updateParent(uintptr_t parent)

View File

@ -221,6 +221,9 @@ uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean scro
// and let's free everything with the immediate widget
g_signal_connect(s->immediate, "destroy", G_CALLBACK(onDestroy), c);
// finally, call gtk_widget_show_all() here to set the initial visibility of the widget
gtk_widget_show_all(s->immediate);
c->internal = s;
return c;
}

View File

@ -68,7 +68,8 @@ void uiWindowSetTitle(uiWindow *w, const char *title)
void uiWindowShow(uiWindow *w)
{
gtk_widget_show_all(w->widget);
// don't use gtk_widget_show_all(); that will override user hidden settings
gtk_widget_show(w->widget);
}
void uiWindowHide(uiWindow *w)