# HG changeset patch # User Olaf Wintermann # Date 1708894669 -3600 # Node ID 94d44bdcad3e36ee321a1f2fdbbf3895793d92e7 # Parent 9389313ac00f16358f97eb35ed0a24eb8b996443 add new scrolledwindow (GTK) diff -r 9389313ac00f -r 94d44bdcad3e ui/gtk/container.c --- a/ui/gtk/container.c Sat Feb 24 20:20:34 2024 +0100 +++ b/ui/gtk/container.c Sun Feb 25 21:57:49 2024 +0100 @@ -281,7 +281,8 @@ UIWIDGET ui_grid_create(UiObject *obj, UiContainerArgs args) { - UiContainer *ct = uic_get_current_container(obj); + UiObject* current = uic_current_obj(obj); + UI_APPLY_LAYOUT1(current, args); GtkWidget *widget; #ifdef UI_GTK3 @@ -314,7 +315,7 @@ widget = grid; } #endif - ct->add(ct, widget, TRUE); + current->container->add(current->container, widget, TRUE); UiObject *newobj = uic_object_new(obj, grid); newobj->container = ui_grid_container(obj, grid); @@ -324,6 +325,19 @@ } +UIWIDGET ui_scrolledwindow_create(UiObject* obj, UiFrameArgs args) { + UiObject* current = uic_current_obj(obj); + UI_APPLY_LAYOUT1(current, args); + + GtkWidget *sw = gtk_scrolled_window_new(NULL, NULL); + UiObject *newobj = uic_object_new(obj, sw); + newobj->container = ui_scrolledwindow_container(obj, sw); + uic_obj_add(obj, newobj); + + return sw; +} + + void ui_select_tab(UIWIDGET tabview, int tab) { gtk_notebook_set_current_page(GTK_NOTEBOOK(tabview), tab); }