Kodi Community Forum

Full Version: radiobutton selected condition
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Is it possible to get the selected state of a radiobutton button within the skin xml?
I want to set the visibility of a control depending whether or not the radiobutton is pressed.

I tired Control.IsSelected(id) which would work in python, but no luck in the skin xml.
Do you mean if it's On or Off?

Code:
SubString(Control.GetLabel(ID),*)

Or just focused?

Code:
Control.HasFocus(ID)</visible>
Yep, I meant when its on or off

Code:
SubString(Control.GetLabel(ID),*)
works perfectly thanks
why not just using the same condition like in your radiobutton <selected> tag?
(2013-01-27, 00:11)phil65 Wrote: [ -> ]why not just using the same condition like in your radiobutton <selected> tag?
Nod
determining if the radio button is selected is done in python, windowxml class, not the skin,
so I don't have a condition in the selected tag
I don't get it, you ask how to determine from the skin when a radiobutton is selected, to enable the visibility of a control in the skin.
What does this have to do with python?

If the radiobutton sets a condition <a> when the user selects it, just have your control check for condition <a>.
If you're using a python script, there isn't necessarily a condition which you can check in the skin.
I get that, it is just that the OP never mentioned a python script in his question.
Apologies for bringing up an old thread, this was the only discussion I could find on determining the state of a radiobutton.

I'm redesigning the addon info dialog and need to determine the state of the auto-updates radiobutton (id #13) for my new buttons. I tried Hitcher's suggestion above, String.Contains(Control.GetLabel(13),*), but it always returns true.

Upon further investigation, it appears that control 13's label is always "Auto update (*)" regardless of whether it is on or off. Is there a reliable way to determine the state of this radiobutton?

Thanks for any suggestions!
must be you ;-)

Image
(2017-01-19, 04:48)ronie Wrote: [ -> ]must be you ;-)
You got me. Smile

After doing more research, it looks like the issue is that SendClick doesn't work with radiobuttons. Any other way to send a click to a radiobutton?

http://forum.kodi.tv/showthread.php?tid=157005
Code:
Control.Message(13,click)

though i doubt the results will be any different if you use that action.
Thanks for the suggestion Ronie, you're right though, that doesn't change the state of the radiobutton either. Will have to figure out where to stick control #13 since it looks like it's not going to work in my custom menu.
Doing a thread necromancy here as I was looking for a solution to this myself and figured something out just now

Make radiobutton id=13 a hidden button e.g.
Code:
<visible allowhiddenfocus="true">false</visible>

Then use another button to set it like so:
Code:
<control type="button" id="9013">
    <label>Auto-Update</label>
    <onclick>SetFocus(13)</onclick>
    <onclick>Action(Select)</onclick>
    <onclick>SetFocus(9013)</onclick>
    <visible>Control.IsEnabled(13)</visible>
</control>
Pages: 1 2