[haiku-development] Query about BOutlineListView

  • From: Zenja Solaja <solaja@xxxxxxxxx>
  • To: haiku-development@xxxxxxxxxxxxx
  • Date: Fri, 5 Apr 2024 19:34:35 +0200

Hi everyone.

I have a BOutlineListView, where on program start I want to
select/highlight an item.

The BListView base class has a Select(index) method, which also sets
private fLastSelected. This is used to turn off highlight on subsequent
invocation.

Sadly, there is no FullListSelectItem(index) for the derived class
BOutlineListView().  The index parameter is mapped differently for a tree
structure, so I cannot call the appropriate Select(actual index) function.

I can get a highlight by calling FullListItemAt(index)>Select(); // note -
no argument to Select, however this does not invoke the code path which
sets fLastSelected. On program start everything appears good, but if I
mouse select another item, I now have 2 visible highlighted items. Which is
wrong.

Long story short, FullListSelectItem(index) would solve this, but it
doesn’t exist for BOutlineListView.

Anyone have a suggestion how to properly select an item on program start?

Other related posts: