From 6e5cf97623c54b67e2de142c1fcf13a3e5212528 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 14 Jun 2016 11:31:10 -0400 Subject: [PATCH] Tied uiForm label visibility on GTK+ to the visibility of the control. This is the only visibility change needed on GTK+, fortunately. --- unix/form.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/unix/form.c b/unix/form.c index 4e1f7fa0..02571d0c 100644 --- a/unix/form.c +++ b/unix/form.c @@ -8,6 +8,7 @@ struct formChild { GtkAlign oldhalign; gboolean oldvexpand; GtkAlign oldvalign; + GBinding *labelBinding; }; struct uiForm { @@ -82,7 +83,10 @@ void uiFormAppend(uiForm *f, const char *label, uiControl *c, int stretchy) gtk_grid_attach(f->grid, fc.label, 0, row, 1, 1); - gtk_widget_show_all(fc.label); + // and make them share visibility so if the control is hidden, so is its label + fc.labelBinding = g_object_bind_property(GTK_WIDGET(uiControlHandle(fc.c)), "visible", + fc.label, "visible", + G_BINDING_SYNC_CREATE); uiControlSetParent(fc.c, uiControl(f)); uiUnixControlSetContainer(uiUnixControl(fc.c), f->container, FALSE);