>>You add a SKIP FOR clause to one of the bars.
>>The SKIP FOR clause calls a function, to which you pass the popup name and the bar number of it
>>
>>The function, when called can change the popup, eg
>>
>>Remove all the bars below its bar number ( for/next in reverse order)
>>Add new bars
>>
>>Been doing that to eg display the contents of a folder
>
>The skip for may be executed too often... so early on in the code I'd check for some condition (perhaps seconds() against the time of last rebuild of the popup) and bail out. Also, even if the condition is met, check for any changes (i.e. all the files same as the last time), and if no changes, also do nothing.
>
>It's pretty much like code you put in a .refresh() - has to be quick and nimble because you never know how many times it may fire.
All the skip clauses fire before any pad of the menu is activated - only then
In the beginning I removed the bars and added them again
It began to be noticeable when there were too many files ( I also included subdirectories ), half a second or so
Since then, I have made a FileSystemWatcher with API and events
I now have only to rebuild when there's been a change in the directory ( or subdirectories)
Gregory