summaryrefslogtreecommitdiff
path: root/new
diff options
context:
space:
mode:
Diffstat (limited to 'new')
-rw-r--r--new/button_unix.c2
-rw-r--r--new/newcontrol_unix.c5
-rw-r--r--new/ui_unix.h4
3 files changed, 5 insertions, 6 deletions
diff --git a/new/button_unix.c b/new/button_unix.c
index 8ab9aa6..a39bdf5 100644
--- a/new/button_unix.c
+++ b/new/button_unix.c
@@ -34,7 +34,7 @@ uiControl *uiNewButton(const char *text)
b = uiNew(struct button);
b->c = uiUnixNewControl(GTK_TYPE_BUTTON,
- FALSE, FALSE, FALSE, b,
+ FALSE, FALSE, b,
"label", text,
NULL);
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);
diff --git a/new/ui_unix.h b/new/ui_unix.h
index 06b6ed8..4e4f6e8 100644
--- a/new/ui_unix.h
+++ b/new/ui_unix.h
@@ -9,10 +9,10 @@ This file assumes that you have included <gtk/gtk.h> and "ui.h" beforehand. It p
// uiUnixNewControl() creates a new uiControl with the given GTK+ control inside.
// The first parameter is the type of the control, as passed to the first argument of g_object_new().
-// The three scrolledWindow parameters allow placing scrollbars on the new control.
+// The two scrolledWindow parameters allow placing scrollbars on the new control.
// The data parameter can be accessed with uiUnixControlData().
// The firstProperty parameter and beyond allow passing construct properties to the new control, as with g_object_new(); end this list with NULL.
-extern uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean needsViewport, gboolean scrolledWindowHasBorder, void *data, const char *firstProperty, ...);
+extern uiControl *uiUnixNewControl(GType type, gboolean inScrolledWindow, gboolean scrolledWindowHasBorder, void *data, const char *firstProperty, ...);
extern void *uiUnixControlData(uiControl *c);
#endif