Thread Rating:
  • 0 Vote(s) - 0 Average
radiobutton selected condition
#1
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.
Reply
#2
Do you mean if it's On or Off?

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

Or just focused?

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

Code:
SubString(Control.GetLabel(ID),*)
works perfectly thanks
Reply
#4
why not just using the same condition like in your radiobutton <selected> tag?
Donate: https://kodi.tv/contribute/donate (foundation), 146Gr48FqHM7TPB9q33HHv6uWpgQqdz1yk (BTC personal)
Estuary: Kodis new default skin - ExtendedInfo Script - KodiDevKit
Reply
#5
(2013-01-27, 00:11)phil65 Wrote: why not just using the same condition like in your radiobutton <selected> tag?
Nod
Reply
#6
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
Reply
#7
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>.
Reply
#8
If you're using a python script, there isn't necessarily a condition which you can check in the skin.
[Image: xp1080-21.png]
Reply
#9
I get that, it is just that the OP never mentioned a python script in his question.
Reply
#10
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!
Reply
#11
must be you ;-)

Image
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#12
(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
Reply
#13
Code:
Control.Message(13,click)

though i doubt the results will be any different if you use that action.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#14
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.
Reply
#15
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>
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
radiobutton selected condition00