fix(widget): child setter

This commit is contained in:
Aylur
2023-11-09 00:51:31 +01:00
parent 19d13a2bf1
commit ec5442899e
+6
View File
@@ -276,6 +276,12 @@ export default function <T extends WidgetCtor>(Widget: T, GTypeName?: string) {
if (typeof this.set_child === 'function')
// @ts-expect-error
this.set_child(child);
// @ts-expect-error
else if (typeof this.add === 'function')
// @ts-expect-error
this.add(child);
else
console.error(Error(`can't set child on ${this}`));
}