fix(widget): child setter

when using the add method, the child before needs to be destroyed
This commit is contained in:
Aylur
2023-11-10 00:14:43 +01:00
parent 99e6ab7f36
commit 75edd513b1
+3
View File
@@ -272,6 +272,9 @@ export default function <T extends WidgetCtor>(Widget: T, GTypeName?: string) {
}
set child(child: Gtk.Widget) {
if (this.child !== child && this.child)
this.child.destroy();
// @ts-expect-error
if (typeof this.set_child === 'function')
// @ts-expect-error