mirror of
https://github.com/zoriya/ags.git
synced 2026-06-02 18:50:51 +00:00
fix(widget): child setter
when using the add method, the child before needs to be destroyed
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user