Recent

Author Topic: [SOLVED] Treeview, possible to late set Node.HasChildren (plus sign)?  (Read 21354 times)

d7_2_laz

  • Hero Member
  • *****
  • Posts: 640
The outcome is: the pinciple is nicely applicable to apps too that don't use the ShellControls itself: it works very fine and fast!
Tremendous speedup .. perfectly solved!
Lazarus 4.0  FPC 3.2.2 Win10 64bit

wp

  • Hero Member
  • *****
  • Posts: 12914
Re: [SOLVED] Treeview, possible to late set Node.HasChildren (plus sign)?
« Reply #31 on: July 15, 2021, 10:58:18 am »
Committed to trunk and requested back-porting to v2.2RC2.

The largest part of the slow-down when a heavily populated node is opened a second time is due to a missing BeginUpdate/EndUpdate pair around Node.DeleteChildren in the ShellTreeView's CanExpand method (about 20 s for c:\Windows\WinSxS) - but this was already included in the pre-version that you used. With BeginUpdate/EndUpdate the delay shortens to about 1 second. I checked the involved procedures and found nothing suspicious. The problem seems to be that all subnodes have to be iterated when their parent node is closed.

d7_2_laz

  • Hero Member
  • *****
  • Posts: 640
Re: [SOLVED] Treeview, possible to late set Node.HasChildren (plus sign)?
« Reply #32 on: July 15, 2021, 02:26:03 pm »
Had guessed such a direction, as after transfer of the change to my app, here the effect did _not_ occur.
I had already noticed this difference in CanExpand, but had not been sure if it was directly related to your recent change / this specific topic.

Btw, it is good to see that the fix from the thread "Trouble with CustomTreeView (OnExpand)" (SIGSEGV at CanExpand when inside Begin-/End-Update) indeed is part of 2.2 - the problem did not reoccur here.

A lot of thanks for having involved so deeply! Great experience.
Lazarus 4.0  FPC 3.2.2 Win10 64bit

 

TinyPortal © 2005-2018