Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » TreeCtrl » how to wake up TreeCtrl
how to wake up TreeCtrl [message #48988] Sat, 18 November 2017 20:02 Go to next message
forlano is currently offline  forlano
Messages: 1031
Registered: March 2006
Location: Italy
Experienced Contributor
Hello,

I am using a TreeCtrl bind to a folder. It shows correctly the files inside it.
However, if I create at runtime a new file in that directory the TreeCtrl is not aware of it. What to do to put in sync the display with the folder structure?
I tried without success .Update() and .Sinc()

Thanks,
Luigi
Re: how to wake up TreeCtrl [message #48989 is a reply to message #48988] Sat, 18 November 2017 20:23 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 535
Registered: August 2007
Location: Turkey
Contributor
Hello Luigi,

AFAIK (I may be wrong) there is no U++ call for that. You need to use native api calls.

For real-time monitoring:

On windows, you can use directory change notification system: https://msdn.microsoft.com/en-us/library/aa365261(VS.85).aspx
On linux, you can use inotify: http://man7.org/linux/man-pages/man7/inotify.7.html

Best regards,
Oblivion

[Updated on: Sat, 18 November 2017 20:26]

Report message to a moderator

Re: how to wake up TreeCtrl [message #48990 is a reply to message #48989] Sat, 18 November 2017 20:47 Go to previous messageGo to next message
forlano is currently offline  forlano
Messages: 1031
Registered: March 2006
Location: Italy
Experienced Contributor
Oblivion wrote on Sat, 18 November 2017 20:23
Hello Luigi,

AFAIK (I may be wrong) there is no U++ call for that. You need to use native api calls.


Unfortunatly the Windows API in this case are cumbersome.
However if I click on the node/folder of the TreeCtrl the new file is displayed. So a sort of sync is performed. I would like to try to simulate the close/open of the node where the file is. Unfortunately I do not understand how each node id map a given folder.

Thanks,
Luigi
Re: how to wake up TreeCtrl [message #48991 is a reply to message #48990] Sat, 18 November 2017 20:57 Go to previous message
Oblivion is currently offline  Oblivion
Messages: 535
Registered: August 2007
Location: Turkey
Contributor
Quote:
Unfortunatly the Windows API in this case are cumbersome.
However if I click on the node/folder of the TreeCtrl the new file is displayed. So a sort of sync is performed. I would like to try to simulate the close/open of the node where the file is. Unfortunately I do not understand how each node id map a given folder.


have you tried FindFile class of U++?
It can check timestamps (directory object change times).

https://www.ultimatepp.org/src$Core$FindFile$en-us.html

Maybe you can "wait on" file/directory changes (manually, using a timer maybe?).

Best regards,
Oblivion
Previous Topic: TreeCtrl display bug
Next Topic: Drag&drop example bug and questions
Goto Forum:
  


Current Time: Tue Feb 19 09:59:21 CET 2019

Total time taken to generate the page: 0.00493 seconds