Posted by member 103440 on 2004-07-08 14:33:42 link

Hi!
Thanks @Tnl and @RabidCow for your suggestions.
After writing this thread I tried to (net)load VTray on "*script start" and it worked better :) but not good enough :( .I loosed the counting of some icons, and when some icons where removed the script worked totally wrong!

-- 1st Case --
So I wrote a new script of my own with a different approach. Instead of using "TaskBarGrow" and "TaskBarShrink" each time a icon was added, I used the %#vTrayCurrentIcons%# and calculated the entire vTraySize. Now it works fine. Here is the script i used:

*Script bang !VTrayChange
*Script exec !VarSet IconNumber "0"
*Script exec !VarAdd IconNumber %#vTrayCurrentIcons%#
*Script exec !IfEval ("%{IconNumber}" = "0") {!TaskbarSize $TaskBarWidth$}
*Script exec !IfEval ("%{IconNumber}" < "1") {!TaskbarShrink "19"}
*Script gotoif ("%{IconNumber}" > "1") SizeCount_lbl
*Script exit
*Script label SizeCount_lbl
*Script exec !VarSet TraySize "0"
*Script exec !VarAdd TraySize "19"
*Script label start
*Script exec !VarAdd IconNumber "-2"
*Script gotoif ("%{IconNumber}" |minus or equal| "0") end
*Script exec !VarAdd TraySize "18"
*Script goto start
*Script label end
*Script exec !TaskbarSize %#TaskBarWidth-%{TraySize}%#
*Script ~bang


"|minus or equal| -> I couldn't put the correct code here, after many edits found the solution... weird bug in this forum"

-- 2nd Case --
After a while i realized that there was another exported variable from vTray -> $vTrayCurrentWidth and i wrote another script (much more simpler ;)) to do the calculation, here it is:

*Script bang !VTrayChangeLite
*Script exec !TaskbarSize %#TaskBarWidth-vTrayCurrentWidth+2%#
*Script ~bang


Before inserting the above script on the onAdd/Del commands from vTray, i tested it manually from LSXCommand and it worked perfectly. But when i switched for this script to the onAdd/Del commands from vTrays and recycled... nothing happened! Very strange indeed! But if i call it manually after the LiteStep Recycle/Loading there is no problem! I put vTray to load in "*script start" and no good either!

Right now, i want to known where the problem is… "vTray" or "mzScript threaded"? Or both!
I will sticky with the first case and do some more testing.
(I don't need to load vTray on "*script start" to work correctly on the first case!)