Kodi Community Forum
Add dynamic text area to XBMC Skin - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Support (https://forum.kodi.tv/forumdisplay.php?fid=33)
+--- Forum: Skins Support (https://forum.kodi.tv/forumdisplay.php?fid=67)
+--- Thread: Add dynamic text area to XBMC Skin (/showthread.php?tid=211084)



Add dynamic text area to XBMC Skin - BigMan - 2014-12-11

Hi Guys,

I was struggling Huh to add dynamic text area to XBMC skin. I need to change the content of the text area when changing the buttons.

Hope you guys can help me on this.

Thanks in advance...!

BR,
BigMan...


RE: Add dynamic text area to XBMC Skin - MassIV - 2014-12-11

You might need to be more specific.

But have you tried using a variable as label, and then give the variable content different conditions?


RE: Add dynamic text area to XBMC Skin - BigMan - 2014-12-12

Thank you for your heads up. I will try your suggestion too. To be frank, I'm a beginner in XBMC.

This is what I want to learn,
I added one more custom page to default XBMC main menu added two buttons that opens new window each. That window has few buttons with a text area. Now I need to know how can we change the content of the text area when we navigate among the buttons.

BR,
BigMan...


RE: Add dynamic text area to XBMC Skin - BigMan - 2014-12-12

Hi MassIV,
I tried your suggestion and It worked. Thank you very much...!
I added new variable to Include.xml file,
<variable name="ContentArea_1">
<value condition="Control.HasFocus(2)">Test One</value>
<value condition="Control.HasFocus(3)">Test Two</value>
<value condition="Control.HasFocus(4)">Test Three</value>
</variable>
Added the variable to label,
<label>$VAR[ContentArea_1]</label>
Now I can get the values in the variables to text area dynamically.

But I dont know how to get this this text from a text file.
<value condition="Control.HasFocus(2)">Test One</value>
Could you help me on this?


BR,
BigMan...


RE: Add dynamic text area to XBMC Skin - Hitcher - 2014-12-12

Do you mean from different labels?

If so, Control.GetLabel(ID).

Also, ask a mod to move this to Skin Development.


RE: Add dynamic text area to XBMC Skin - BigMan - 2014-12-12

I have a some text in the test.txt file. I meant to say that I want to get those text to display instead of hard-code "Test One" here. My input text from a text file.

<value condition="Control.HasFocus(2)">Test One</value>


RE: Add dynamic text area to XBMC Skin - MassIV - 2014-12-12

Do you have a reason for wanting to read from a .txt file?

Assuming you or some application needs to change the content of the .txt file(s)?
There isn't a native way of reading non .xml files or files outside of the skin folder in the skinning engine.
So you'd have t use a simple python script to read the .txt file.
And give your label control an ID, then your script can change the label of ID.