diff -r d7a7fb79b5f7 -r 49bc645df8b7 ui/gtk/container.c --- a/ui/gtk/container.c Wed Jan 27 12:52:39 2016 +0100 +++ b/ui/gtk/container.c Wed Jan 27 20:55:37 2016 +0100 @@ -183,6 +183,22 @@ } #endif +UiContainer* ui_scrolledwindow_container(UiObject *obj, GtkWidget *scrolledwindow) { + UiContainer *ct = ucx_mempool_calloc( + obj->ctx->mempool, + 1, + sizeof(UiContainer)); + ct->widget = scrolledwindow; + ct->add = ui_scrolledwindow_container_add; + return ct; +} + +void ui_scrolledwindow_container_add(UiContainer *ct, GtkWidget *widget, UiBool fill) { + gtk_container_add(GTK_CONTAINER(ct->widget), widget); + ui_reset_layout(ct->layout); + ct->current = widget; +} + UiContainer* ui_tabview_container(UiObject *obj, GtkWidget *tabview) { UiTabViewContainer *ct = ucx_mempool_calloc( obj->ctx->mempool, @@ -308,6 +324,18 @@ return widget; } +UIWIDGET ui_scrolledwindow(UiObject *obj) { + UiContainer *ct = uic_get_current_container(obj); + GtkWidget *sw = gtk_scrolled_window_new(NULL, NULL); + ct->add(ct, sw, TRUE); + + UiObject *newobj = uic_object_new(obj, sw); + newobj->container = ui_scrolledwindow_container(obj, sw); + uic_obj_add(obj, newobj); + + return sw; +} + UIWIDGET ui_tabview(UiObject *obj) { GtkWidget *tabview = gtk_notebook_new(); gtk_notebook_set_show_border(GTK_NOTEBOOK(tabview), FALSE);