PDA

View Full Version : Bug with RegisterVariableWatch on NR2 ?



Manser
October 23rd, 2006, 01:51 AM
I want to hide a button witch set steps back in the library tree
because it should't go back to the beginning of the tree!!
But I only want to go back until

onCCFLoad:

RegisterVariableWatch('MP.GACParentScheme', backButtonHiden);

Function:

function backButtonHiden()
print ("Funktion aufgerufen!!!!");
local ParentPath=NetRemote.GetVariable("MP.GACParentScheme"); -- liest den Zurück-Pfad aus
if (string.len(ParentPath)==19) and(string.sub(ParentPath, 15, 21)=='Audio') -- 'Media Library\Audio'
or (string.len(ParentPath)==9) and(ParentPath=='Playlists') then -- 'Playlists'
NetRemote.SetVariable("BackButtonHiden", 1);
else
NetRemote.SetVariable("BackButtonHiden", 0);
end
end

This works well on NetRemote V.1.1.0.44
But it will not work on NetRemote V 2.0.0.76 ??????
The problem is that registerVariableWatch don't call the function.

Rob H
October 23rd, 2006, 04:38 AM
Try using NetRemote.RegisterVariableWatch() instead of just RegisterVariableWatch.

Manser
October 23rd, 2006, 05:21 AM
Yes, thats right!

Thanks a lot Rob

Manser
October 24th, 2006, 01:39 AM
Oh my dear!

The next problem i can't handle at the moment is that NR2 never hide the bIody
button. ;-)
This works great in NR1 but not in NR2.

I Have two states on this button
Default and state1 and the rule on state1 is simple:
"BackButtonHiden is 0" >> Hide when false

The var BackButtonHiden works correct!

Rob H
October 24th, 2006, 02:18 AM
What I tend to do is make the default state the hidden state and state1 the visible state. Try deleting your existing state 1 and create a new one.

Ben S
October 24th, 2006, 03:11 AM
Manser - if you plan on running NR2, go into the system properties of the ccf in NRD and change it's format to NRD 1.1 format. You can then do what Rob suggests.

Rob H
October 24th, 2006, 03:24 AM
Ah, good point there Ben, I'd forgotten about the format differences.

Manser
October 24th, 2006, 05:22 AM
Thank you guys.
Thats was easy to fix.

Have a nice day, Best wishes form switzerland

simon