# HG changeset patch # User Olaf Wintermann <olaf.wintermann@gmail.com> # Date 1740590464 -3600 # Node ID 6292f93c22130eb49b93226981058b0271b205a4 # Parent be34594ee942f588334e29fe3c50f09ffcc5a725 implement ui_customwidget_create (WINUI3) diff -r be34594ee942 -r 6292f93c2213 ui/winui/container.cpp --- a/ui/winui/container.cpp Wed Feb 26 17:39:03 2025 +0100 +++ b/ui/winui/container.cpp Wed Feb 26 18:21:04 2025 +0100 @@ -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 -------------------- *