Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Ultra App Kit -> Tree View Scrolling Bug


Recommended Posts

  • m.yuneeb90 changed the title to Ultra App Kit -> Tree View Scrolling Bug

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;

 

  • Like 1
Link to post
Share on other sites
  • Josh locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...