Sun, 25 Feb 2024 21:57:49 +0100
add new scrolledwindow (GTK)
ui/gtk/container.c | file | annotate | diff | comparison | revisions |
--- 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); }