A script that loops through the buttons of an active bar and sets some of them 
invisible takes several 
seconds to update my active bar. Why is that, and what can I do to speed it up?
This is particularly true when the bar is repainted after switching from 
another virtual desktop.

Summaries of bar and script definitions follow, sorry if it's complicated, I 
did try to strip it down as much 
as possible. The bar is:

[An existing active bar:Properties]
Format1 = Position: FixedTopLeft
[1]
Id = one
LCmd1 = ; whatever
...
[10]
Id = stop at this button
LCmd1 = ; whatever

The script is:

local bar="An existing active bar"
local hcl=cl.get(bar)

if(visiblewindow(bar))
  hcl.close
miscplugin.sleep(250)

// this loop takes a long time, why?
local bShow=0   // or =1
for(i=0; 1; i++)
  if("stop at this button" == hcl.getid(i))
    break
  // bar shows up unpredictably when switching from another vdesk
  window.hide_(bar)
  hcl.setvisible(i, bShow)
  endfor

// if I don't do exactly show.addproperties.refresh in this
// order bar won't be updated or won't show...
hcl.show;;+
.addproperties("Format=Position: BottomEdgeCurrentSize");;+
.refresh

Reply via email to