From 19b85182b83e1eb6d8b91209594adb2f405a19bf Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Mon, 13 Apr 2015 12:05:14 -0400 Subject: Did the GTK+ conversion to uiParent. Now to build. --- new/newcontrol_unix.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'new/newcontrol_unix.c') diff --git a/new/newcontrol_unix.c b/new/newcontrol_unix.c index 5779af2..c56ef8d 100644 --- a/new/newcontrol_unix.c +++ b/new/newcontrol_unix.c @@ -7,7 +7,7 @@ struct singleWidget { GtkWidget *widget; GtkWidget *scrolledWindow; GtkWidget *immediate; // the widget that is added to the parent container; either widget or scrolledWindow - uintptr_t parent; + uiParent *parent; gboolean userHid; gboolean containerHid; gboolean userDisabled; @@ -28,13 +28,13 @@ static uintptr_t singleHandle(uiControl *c) return (uintptr_t) (s->widget); } -static void singleSetParent(uiControl *c, uintptr_t parent) +static void singleSetParent(uiControl *c, uiParent *parent) { singleWidget *s = (singleWidget *) (c->internal); s->parent = parent; gtk_container_add(GTK_CONTAINER(s->parent), s->immediate); - updateParent(s->parent); + uiParentUpdate(s->parent); } static void singleRemoveParent(uiControl *c) @@ -45,7 +45,7 @@ static void singleRemoveParent(uiControl *c) oldparent = s->parent; s->parent = NULL; gtk_container_remove(GTK_CONTAINER(oldparent), s->immediate); - updateParent(oldparent); + uiParentUpdate(oldparent); } static void singlePreferredSize(uiControl *c, uiSizing *d, intmax_t *width, intmax_t *height) @@ -89,7 +89,8 @@ static void singleShow(uiControl *c) s->userHid = FALSE; if (!s->containerHid) { gtk_widget_show_all(s->immediate); - updateParent(s->parent); + if (s->parent != NULL) + uiParentUpdate(s->parent); } } @@ -99,7 +100,8 @@ static void singleHide(uiControl *c) s->userHid = TRUE; gtk_widget_hide(s->immediate); - updateParent(s->parent); + if (s->parent != NULL) + uiParentUpdate(s->parent); } static void singleContainerShow(uiControl *c) @@ -109,7 +111,8 @@ static void singleContainerShow(uiControl *c) s->containerHid = FALSE; if (!s->userHid) { gtk_widget_show_all(s->immediate); - updateParent(s->parent); + if (s->parent != NULL) + uiParentUpdate(s->parent); } } @@ -119,7 +122,8 @@ static void singleContainerHide(uiControl *c) s->containerHid = TRUE; gtk_widget_hide(s->immediate); - updateParent(s->parent); + if (s->parent != NULL) + uiParentUpdate(s->parent); } static void singleEnable(uiControl *c) -- cgit v1.2.3