8 static void GetAllChildren(notnull Widget widget, notnull out array<ref Widget> widgetArray,
bool recursive =
false)
10 Widget child = widget.GetChildren();
13 widgetArray.Insert(child);
15 GetAllChildren(child, widgetArray,
true);
16 child = child.GetSibling();
21 static void RemoveAllChildren(notnull Widget widget)
23 while (widget.GetChildren())
25 widget.GetChildren().RemoveFromHierarchy();
30 static void ResizeToImage(notnull ImageWidget widget,
int imageIndex = 0)
33 widget.GetImageSize(imageIndex, x, y);
41 static Widget GetRootWidget(notnull Widget widget)
43 WorkspaceWidget topTopParent = widget.GetWorkspace();
45 while (widget && widget != topTopParent)
48 widget = parent.GetParent();
56 static Widget GetWidgetOrChild(notnull Widget widget,
string widgetName)
58 if (widget.GetName() == widgetName)
61 return widget.FindAnyWidget(widgetName);