wxTreeCtrl::EnsureVisible expands only one item

Dan Korn <[email protected]> Thu, 12 Jun 2025 11:59:57 -0700 (PDT)
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hello,

We have been using wxWidgets for many years in our product on Windows and 
Mac.

One of our dialogs shows a wxTreeCtrl with a lot of nested items, and 
there's a Search box where the user can type a string, and the control 
highlights all matching nodes.  It also calls EnsureVisible() for each 
matching node.

On Mac, and on Windows in wxWidgets 3.1 (and all versions prior to 3.2), 
this would expand every matching node.  Successive calls to EnsureVisible() 
would leave open previous nodes on which it had been called.  So after 
going through the tree recursively and highlighting and opening up each 
match, the user can see them all easily (though they may need to scroll the 
window).

Now, however, in wxWidgets 3.2 on Windows, when EnsureVisible() is called, 
all previously opened nodes are closed.  So only the last matching item is 
left open.  This is a regression, as users are confused because they no 
longer see all the matching items.

Was this an intentional change to wxTreeCtrl?  Is there any workaround, so 
that all matching nodes can be opened?

Thanks,
Dan

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion visit https://groups.google.com/d/msgid/wx-users/9e363b26-6ebf-4677-b500-f7c0fe2a5b0cn%40googlegroups.com.