--- a/ui/winui/container.cpp Tue Feb 25 21:11:00 2025 +0100 +++ b/ui/winui/container.cpp Sat Apr 05 16:46:11 2025 +0200 @@ -51,6 +51,19 @@ } +UIEXPORT UIWIDGET ui_customwidget_create(UiObject *obj, ui_createwidget_func create_widget, void *userdata, UiWidgetArgs args) { + UiObject* current = uic_current_obj(obj); + + UIWIDGET widget = create_widget(obj, args, userdata); + FrameworkElement w = widget->uielement.as<FrameworkElement>(); + + UI_APPLY_LAYOUT1(current, args); + + current->container->Add(w, false); + + return widget; +} + // --------------------- UiBoxContainer --------------------- static UIWIDGET ui_box(UiObject* obj, UiContainerArgs args, UiBoxContainerType type) { @@ -873,6 +886,7 @@ } + /* * -------------------- Layout Functions -------------------- * @@ -905,6 +919,11 @@ ct->layout.vfill = fill; } +void ui_layout_override_defaults(UiObject* obj, UiBool def) { + UiContainer* ct = uic_get_current_container(obj); + ct->layout.override_defaults = def; +} + void ui_layout_width(UiObject* obj, int width) { UiContainer* ct = uic_get_current_container(obj); ct->layout.width = width;