I am trying to make a modal TreeView selector. I want to scroll to a previously selected item.
Before ronModalLoop() I add the TreeViewItems and if I find a previously selected one:
if (selectedItem != 0)
{
treeView->scrollToKeepItemVisible(selectedItem);
selectedItem->setSelected(true, true);
}
but in
void TreeView::scrollToKeepItemVisible (TreeViewItem* item)
{
if (item != 0 && item->ownerView == this)
item->ownerView is valid but “this” is not?? So naturally it does not scroll.
What’s going on here?