Changing toggle button state
#1
Hi,

I have a list of togglebutton's and I would like to unselect one before the new one is selected.

I tried python but it doesn't have the type tooglebutton or something like that.
Is there anyway to do this via the XML of the skin?

Can anyone help me?

Regards
Reply
#2
You could do it via skin conditionals. i.e. you'd toggle a setting on and have the other toggle buttons have a <usealttexture> conditional on that setting.

It's a bit messy - ideally we'd support some sort of "radio button group" to tie them together into a mutually exclusive thing. Generally we use a spinner for this sort of thing, but I admit that it doesn't always work the best.

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
#3
How can I access the settings that you are talking about?
Reply
#4
I have this script from a boxee app:
def resetMenu(id):
reg = mc.GetApp().GetLocalConfig()
reg.ResetAll()
reg.SetValue(str(id), "true")

then call it via:
<usealttexture>App.HasSetting(9001)</usealttexture>
<onclick lang="python">
<![CDATA[resetMenu(9001)]]>
</onclick>

It possible to translate?
Reply
#5
Found it...

<usealttexture>Skin.HasSetting(7560)</usealttexture> <---- Verifies if the setting is set
<onclick> Skin.ResetSettings()</onclick> <---- Clear all the settings
<onclick>Skin.ToggleSetting(7560)</onclick> <---- Activate a setting
<onclick>Skin.ToggleSetting(776)</onclick>
Reply
#6
Anyone knows if there's a way to do this inside the python scriptHuh?
Reply
#7
Answering my own question Big Grin For anyone with the same problem.

xbmc.executebuiltin("Skin.ResetSettings()")
xbmc.executebuiltin("Skin.ToggleSetting(%s)"%self.selectedMainButton) #main bar button
xbmc.executebuiltin("Skin.ToggleSetting(%s)"%self.selectedMosaicPanel)
Reply

Logout Mark Read Team Forum Stats Members Help
Changing toggle button state0