Odd problems with Window.IsVisible/isActive
#1
I'm attempting to make some slight changes in the display depending on whether the video LIBRARY is active or the video FILES is active.

I'm trying to do this using either Window.IsVisible() or Window.IsActive() but i'm having some issues. The check for the LIBRARY window's ID works fine, but the check for the FILES window's ID never returns true.

The code where i'm doing the checks:
Code:
            <control type="button" id="11">
                <description>Library button</description>
                <posx>0</posx>
                <posy>40</posy>
                <width>182</width>
                <height>32</height>
                <label>Files Mode</label>
                <onclick>ReplaceWindow(myvideofiles)</onclick>
                <onclick>SetFocus(11)</onclick>
                <onleft>50</onleft>
                <onright>50</onright>
                <onup>1</onup>
                <ondown>10</ondown>
                <texturefocus>videolibrary_menu_selected.png</texturefocus>
                <texturenofocus>-</texturenofocus>
                <font>font20</font>
                <textcolor>FFFFFFFF</textcolor>
                <focusedcolor>FFFFFFFF</focusedcolor>
                <disabledcolor>disabled</disabledcolor>
                <textoffsetx>10</textoffsetx>
                <aligny>center</aligny>
                <visible>Window.IsVisible(25)</visible>
            </control>
            <control type="button" id="11">
                <description>Library button</description>
                <posx>0</posx>
                <posy>40</posy>
                <width>182</width>
                <height>32</height>
                <label>Library Mode</label>
                <onclick>ReplaceWindow(myvideolibrary)</onclick>
                <onclick>SetFocus(11)</onclick>
                <onleft>50</onleft>
                <onright>50</onright>
                <onup>1</onup>
                <ondown>10</ondown>
                <texturefocus>videolibrary_menu_selected.png</texturefocus>
                <texturenofocus>-</texturenofocus>
                <font>font20</font>
                <textcolor>FFFFFFFF</textcolor>
                <focusedcolor>FFFFFFFF</focusedcolor>
                <disabledcolor>disabled</disabledcolor>
                <textoffsetx>10</textoffsetx>
                <aligny>center</aligny>
                <visible>Window.IsVisible(6)</visible>
            </control>

I've checked that the window IDs are correct multiple times. I have the right numbers in there. The first version of the button, the one checking window ID 25 shows up properly when it should, and hides properly when it should. The second one however, the one that checks on window ID 6, never shows up.
Reply
#2
you right it dosn't seem to work with the number but maybe you could use its english name which will be better for future reference
<visible>Window.IsVisible(myvideofiles)</visible>
and you also have myvideolibrary
Reply
#3
Jezz_X Wrote:you right it dosn't seem to work with the number but maybe you could use its english name which will be better for future reference
<visible>Window.IsVisible(myvideofiles)</visible>
and you also have myvideolibrary

Hmm.. I thought that I had also tried that and the result was always true on them both. Might have had the wrong names though, so let me give it another try.
Reply
#4
honestly your code looks odd to me anyway why would you have 2 buttons the same in both the video windows when you clearly only need the 1 because its always going to come up negative on at leasy one of them ?
Or are you adding these buttons to a different dialog or something ?
Reply
#5
Jezz_X Wrote:honestly your code looks odd to me anyway why would you have 2 buttons the same in both the video windows when you clearly only need the 1 because its always going to come up negative on at leasy one of them ?
Or are you adding these buttons to a different dialog or something ?

They aren't the same. These are the buttons to switch between library and files mode. One would display in library mode with the onclick set to swap you to files mode, and the other one the other way around.
Reply
#6
So is there an issue here or not? I don't wish to be chasing ghosts Wink

My advice is to always use the window's name.

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#7
jmarshall Wrote:So is there an issue here or not? I don't wish to be chasing ghosts Wink

My advice is to always use the window's name.

Cheers,
Jonathan

JM, i'm sorry but I haven't gotten around to trying it with the window names yet. I can however say it does not work with the window IDs. The documentation states it should work with the ID, so either the function is bugged or just the docs need to be changed. I think there is a bug though since it works fine for one window ID, just not the other.

If you want to hold off though until my weekend, i'll test it out a big more completely for you.
Reply
#8
Sounds like you have the wrong id in that case Wink

IIRC id 6 is a "placeholder" id that isn't actually a real window. I don't have the code in front of me though, so cannot check it - check Key.h in the guilib source.

Cheers
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#9
jmarshall Wrote:Sounds like you have the wrong id in that case Wink

IIRC id 6 is a "placeholder" id that isn't actually a real window. I don't have the code in front of me though, so cannot check it - check Key.h in the guilib source.

Cheers
Jonathan

Well I was checking against ID 6 because thats the ID given to the window in the XML file Smile Anyway come tuesday/wednesday i'll dig into it a bit and see what I see.
Reply
#10
Use Key.h as the definitive source for id's and whatnot, and the online manual secondly.
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#11
Update on this - If I use the window names as suggested by Jezz_X, it works properly. Thanks!

jmarshall Wrote:Use Key.h as the definitive source for id's and whatnot, and the online manual secondly.

I'm not sure I totally understand what you are getting at here. Are you saying that the window ID given in the actual skin XML file is NOT the window's ID, that internally the engine gives it is own ID regardless of what is set in the XML?
Reply
#12
I've got a related question - if I'm in the video library window and from there open a custom settings window (via XBMC.ActivateWindow), is it possible to adapt the buttons on the settings window based on which window it was launched from.

For example, I thought I could check Window.IsVisible(myvideolibrary) but this is always false (I tried Window.IsActive too and got the same result)

Am I barking up the wrong tree?
Reply
#13
skunkm0nkee Wrote:I've got a related question - if I'm in the video library window and from there open a custom settings window (via XBMC.ActivateWindow), is it possible to adapt the buttons on the settings window based on which window it was launched from.

For example, I thought I could check Window.IsVisible(myvideolibrary) but this is always false (I tried Window.IsActive too and got the same result)

Am I barking up the wrong tree?

Perhaps you could set a skin bool OnClick allowing you to determine where it was launched.
Reply
#14
agathorn: Yes, that is correct. Only custom window's id's are respected in the XML - the rest are assigned in XBMC itself (as per the defines in Key.h). For instance, SettingsCategory.xml is actually 8 separate windows each with unique id's, which ofcourse you can't specify in the XML.

skunk: Only 1 window is shown at a time. A dialog type will keep the window active though, or agathorn's OnClick() idea would do the trick (albeit not particularly efficient).

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply

Logout Mark Read Team Forum Stats Members Help
Odd problems with Window.IsVisible/isActive0