haxeui / haxeui-hxwidgets

The hxWidgets backend of the HaxeUI framework -
http://haxeui.org
MIT License
23 stars 7 forks source link

Removing tabview on Linux makes app crash #34

Open Shallowmallow opened 1 year ago

Shallowmallow commented 1 year ago

Current Behavior

It crashes

#1  0x000055555643c42b in wxBookCtrlBase::DeletePage(unsigned long) ()
#2  0x00005555563ff967 in wxNotebook::DeleteAllPages() ()
#3  0x00005555563ffee8 in wxNotebook::~wxNotebook() ()

Possible Solution

I have no idea. But a workaround is to hide the tabview instead.

Test app / minimal test case

import haxe.ui.containers.VBox;
import haxe.ui.events.MouseEvent;

@:xml('
<vbox width="100%" height="100%">
<button id="button" text="remove tab"/>
<tabview id="tab" width="100%" height="100%">
<vbox id="text_editor_tab" text ="TEXT_PREVIEW" width="100%" height="100%">
</vbox>
</tabview>
</vbox>')
class A003 extends VBox {

    @:bind(button, MouseEvent.CLICK)
    private function removeTab(e) {
        removeComponent(tab);
    }

}

Clicking on the button makes the app crash.

Your Environment

MxLinux 22 wxwidgets 3.2.1