mIRC Homepage
Posted By: Asterix_UO $window().sbstate and .tbstate - 26/05/08 11:42 AM
The prop sbstate and tbstate for windows return wrong result when the switchbar or treebar is hidden...

ex.: //swtichbar off | window @a | echo -ga $window(@a).sbstate
return 0, switchbar is hidden not the window... so, this is not be to return 1?

sorry for my english, i don't speek very well laugh
Posted By: genius_at_work Re: $window().sbstate and .tbstate - 26/05/08 01:47 PM
sbstate shows that the switchbar button for that window is visible. If the switchbar is off, the button is obviously hidden (0).

tbstate does the same thing for the treebar buttons.

This is likely meant to work with the /window -w[n] @window command.

-genius_at_work
Posted By: Asterix_UO Re: $window().sbstate and .tbstate - 26/05/08 05:09 PM
yeah... but i made my personal script with pw and my switchbar is pw too so how my script can know if the window was openned with -w[N]?

tks
Posted By: argv0 Re: $window().sbstate and .tbstate - 26/05/08 07:25 PM
You'll have to code that logic yourself then. Likely, you can no longer use /window -wN to create your custom windows using your setup.

The switchbar behaviour is not a bug-- it returns whether the button in the switchbar is visible or not-- to you.. not to the switchbar. When the switchbar is hidden, can you see the button? If not, then the result is accurate.
Posted By: Asterix_UO Re: $window().sbstate and .tbstate - 27/05/08 12:20 PM
ok, but in the help says

sbstate returns switchbar button state for a window
tbstate returns treebar button state for a window

its not saying that is visible to me... its saying visible to switchbar or treebar, no?

Posted By: Khaled Re: $window().sbstate and .tbstate - 10/06/08 04:34 PM
These properties take into account whether the bar is visible or not - so they do in fact indicate whether the button is visible to you. This is how I originally coded the routine. However I can change it so that they indicate whether the button is visible in the bar, even if the bar is hidden, so that scripts can set/get these settings reliably. Unless anyone sees an issue with that, I'll make this change for the next version.
© mIRC Discussion Forums