From abf976ef44f1241433dbacd68481cf3b18ca194f Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 8 Apr 2015 16:24:11 -0400 Subject: Removed the need for specifying if a GTK+ widget needs to be in a GtkViewport for it to be scrollable; the new control code finds out itself now in the same way newer versions of GTK+ do. --- new/newcontrol_unix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'new/newcontrol_unix.c') diff --git a/new/newcontrol_unix.c b/new/newcontrol_unix.c index b424aa6..e032f8b 100644 --- a/new/newcontrol_unix.c +++ b/new/newcontrol_unix.c @@ -60,7 +60,7 @@ static void onDestroy(GtkWidget *widget, gpointer data) uiFree(c); } -uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean needsViewport, gboolean scrolledWindowHasBorder, void *data, const char *firstProperty, ...) +uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean scrolledWindowHasBorder, void *data, const char *firstProperty, ...) { uiSingleWidgetControl *c; va_list ap; @@ -73,10 +73,9 @@ uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean need c->immediate = c->widget; // TODO turn into bit field? - // TODO should we check to see if the GType implements GtkScrollable instead of having this passed as a parameter? if (inScrolledWindow) { c->scrolledWindow = gtk_scrolled_window_new(NULL, NULL); - if (needsViewport) + if (!GTK_IS_SCROLLABLE(c->widget)) gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(c->scrolledWindow), c->widget); else gtk_container_add(GTK_CONTAINER(c->scrolledWindow), c->widget); -- cgit v1.2.3