diff options
| author | Pietro Gagliardi <[email protected]> | 2015-04-08 16:24:11 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2015-04-08 16:24:11 -0400 |
| commit | abf976ef44f1241433dbacd68481cf3b18ca194f (patch) | |
| tree | fbb31deb8517b9117168a3ddd0f19312cbff4d7a /new/newcontrol_unix.c | |
| parent | 090977fa0a9d124a0be121d420733dcb061e3cf7 (diff) | |
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.
Diffstat (limited to 'new/newcontrol_unix.c')
| -rw-r--r-- | new/newcontrol_unix.c | 5 |
1 files changed, 2 insertions, 3 deletions
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); |
