m.yuneeb90 Posted April 5, 2021 Share Posted April 5, 2021 I discovered a few bugs with tree view scrolling in resizable window, I set the layout to (1,1,1,1) in order resize it with the window. The bug is demonstrated in the following video. https://youtu.be/6wUIF0_orUQ Link to comment Share on other sites More sharing options...
Solution Josh Posted April 5, 2021 Solution Share Posted April 5, 2021 I copied the default CreateTreeView example, made the window resizable, and set the treeview layout to 1,1,1,1. When I interact with the slider the program crashes. It is casting event.extra without checking if it is NULL: case EVENT_WIDGETACTION: Print("Action: " + event.extra->As<Widget>()->text); When the treeview slider gets moved, it emits an action event of its own, and since the event does not store an extra value it causes a crash. To fix it you can change that block of code to this: case EVENT_WIDGETACTION: if (event.source == treeview) { Print("Action: " + event.extra->As<Widget>()->text); node = event.extra->As<Widget>(); if (!node->kids.empty()) { if (node->Collapsed()) { node->Expand(); } else { node->Collapse(); } } } break; 1 My job is to make tools you love, with the features you want, and performance you can't live without. Link to comment Share on other sites More sharing options...
Recommended Posts