haxeui / haxeui-hxwidgets

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

Tableview crashes on Linux #48

Closed Shallowmallow closed 11 months ago

Shallowmallow commented 11 months ago

Current Behavior

If you have a table in your app, you will have a popup ASSERT INFO: ../src/gtk/window.cpp(2479): assert "m_wxwindow" failed in AddChildGTK(): Cannot add a child to a window without a client area

BACKTRACE: [1] wxWindow::AddChildGTK(wxWindow) [2] wxStaticText::Create(wxWindow, int, wxString const&, wxPoint const&, wxSize const&, long, wxString const&) [3] __libc_start_main [4] _start

Ugly fix

Add if ("" + id == "button-label") return; at the beginning https://github.com/haxeui/haxeui-hxwidgets/blob/7789797469f4ecce0cb43f4ace3be67b217bc92c/haxe/ui/backend/ComponentImpl.hx#L109

Reasons

The problem is the "button-label" of the columns. Somehow the static text cannot be added to hx widget buttons because they are a "window without a client area".

Possible solutions

Shallowmallow commented 11 months ago

I'll use this solution for now, so no urgency, I can play with my tables :) https://github.com/haxeui/haxeui-hxwidgets/pull/49

Shallowmallow commented 11 months ago

Works well now :)