mIRC Home    About    Download    Register    News    Help

Print Thread
$window().sbstate and .tbstate #200034 26/05/08 11:42 AM
Joined: May 2006
Posts: 27
A
Asterix_UO Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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


Suchorski @ FreeNode
Re: $window().sbstate and .tbstate [Re: Asterix_UO] #200043 26/05/08 01:47 PM
Joined: Oct 2005
Posts: 1,741
G
genius_at_work Offline
Hoopy frood
Offline
Hoopy frood
G
Joined: Oct 2005
Posts: 1,741
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

Re: $window().sbstate and .tbstate [Re: Asterix_UO] #200050 26/05/08 05:09 PM
Joined: May 2006
Posts: 27
A
Asterix_UO Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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


Suchorski @ FreeNode
Re: $window().sbstate and .tbstate [Re: Asterix_UO] #200052 26/05/08 07:25 PM
Joined: Oct 2003
Posts: 3,918
A
argv0 Offline
Hoopy frood
Offline
Hoopy frood
A
Joined: Oct 2003
Posts: 3,918
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.


- argv[0] on EFnet #mIRC
- "Life is a pointer to an integer without a cast"
Re: $window().sbstate and .tbstate [Re: argv0] #200077 27/05/08 12:20 PM
Joined: May 2006
Posts: 27
A
Asterix_UO Offline OP
Ameglian cow
OP Offline
Ameglian cow
A
Joined: May 2006
Posts: 27
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?



Suchorski @ FreeNode
Re: $window().sbstate and .tbstate [Re: Asterix_UO] #200725 10/06/08 04:34 PM
Joined: Dec 2002
Posts: 5,152
Khaled Offline
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 5,152
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.