Recent

Author Topic: TreeView Refresh  (Read 7416 times)

wp

  • Hero Member
  • *****
  • Posts: 11830
Re: TreeView Refresh
« Reply #15 on: September 19, 2021, 12:31:57 am »
It works perfectly fine over here with 2.0.4, 6 etc
I don't have these versions any more. With 2.0.8, it does NOT work, but it DOES work with 1.8.4.

We should also check whether it works on Linux or mac to see wether the issue is in widgetset code.

GAN

  • Sr. Member
  • ****
  • Posts: 370
Re: TreeView Refresh
« Reply #16 on: September 19, 2021, 03:22:06 am »
Works fine on Linux Mint 19.3 Mate (GTK). Lazarus 2.0.8 / FPC 3.0.4.
Lazarus 2.0.8 FPC 3.0.4 Linux Mint Mate 19.3
Zeos 7̶.̶2̶.̶6̶ 7.1.3a-stable - Sqlite 3.32.3 - LazReport

BIT

  • Full Member
  • ***
  • Posts: 158
Re: TreeView Refresh
« Reply #17 on: September 19, 2021, 04:26:07 pm »
I'll try to load the TreeView in a separate thread, maybe something confuses when the form is loaded.

BIT

  • Full Member
  • ***
  • Posts: 158
Re: TreeView Refresh
« Reply #18 on: October 07, 2021, 09:26:46 pm »
It seems there is a lock on the window update if the size of the window is the same as the last time an update to the window was requested.

 I am not sure if this is related to the Widget or LCL code but i had to do a hack to force an update to the combo box so that it would fully paint its border.

 I have seen code in the TControl I beleve or TWinControl that does check for the current size verses the changed size request coming in and if they are the same the request gets aborted. This may have something to do with it.

 In your OnResizeEvent which comes when the form is actually visible do this.

Code: Pascal  [Select][+][-]
  1. TreeView.Width := Treeview.Width-1;
  2. TreeView.Width := Treeview.Width+1;
  3.  
The first will be a different size than currently and allow for the control to refresh and the second puts it back to where it was.

This all happens during a cache update so there is no flicker but you should see  your TreeView display as you wish.
Thanks! I thought about it, how will I get back to the project and check it out.

 

TinyPortal © 2005-2018