Treeview population issues

Get help with using AutoHotkey and its commands and hotkeys
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Treeview population issues

17 Jun 2017, 14:45

Hi!

My script is suffering from a bug which I cant seem understand why that is nor how to prevent it from happening.
Each button is tied to a certain folder. Pressing a button (GetFiles) loads all folder contents (for that folder) in a treeview.
One of the buttons (music collection) is associated with a folder with a very large amounts of subfolders and files and it can take several seconds to load the content into the treeview. Now If pressing the music collection button and then pressing an another button (before treeview has loaded the music collection) the treeview contents from the second button press are there alright, but mixed in with some contents from the music collection. In other words the treeview displays contents from two different folders. AddFoldersAndFilesToTree() has not entirely cleared the contents from the interrupted first buttonpress despite FolderList, FileList and SortList are cleared on each AddFoldersAndFilesToTree() call.

Maybe someone with a fresh set of eyes could spot my mistake?
The script posted is non-functional, just the GetFiles label and the AddFoldersAndFilesToTree().
Spoiler
User avatar
Capn Odin
Posts: 1308
Joined: 23 Feb 2016, 19:45
Location: Denmark

Re: Treeview population issues

17 Jun 2017, 16:20

The issue is likely that the buttons start a new "thread" witch interrupts the previous "thread" try adding Critical to the top of your label.
Please excuse my spelling I am dyslexic.
zcooler
Posts: 455
Joined: 11 Jan 2014, 04:59

Re: Treeview population issues

17 Jun 2017, 17:36

I can unfortunately still get contents from two folders in the treeview even if using critical in the GetFiles label.

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 48 guests