Jump to content

Ultra App Kit -> Tree View Scrolling Bug


m.yuneeb90
 Share

Go to solution Solved by Josh,

Recommended Posts

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

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

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

  • Josh locked this topic
Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...