Guest - Testers are needed for the reworked CDateTime core component. See... https://forum.kodi.tv/showthread.php?tid=378981 (September 29) x
getting a edit control label from python script
#1
hi

i'm trying to get a edit control label from python script but i can't find any info about this.

can anybody give me a hint?

Thanks for your reply.
Reply
#2
the way I have seen it done is to use a window property.

in your xml file:

Code:
<control type="label">
    <label>$INFO[Window.Property(some_unique_identifier)]</label>
</control>

if your py file:

Code:
<window class>.setProperty('some_unique_indentifier', some_value)
Reply
#3
(2024-10-02, 16:50)dickfitzwell Wrote: setProperty
Reply
#4
thank you for your reply,
but can you give me the correkt python statement for getting a value from the skin (an edit control label text)?

Thanks for your reply.
Reply
#5
disregard, I mistakenly thought you were trying to edit the label, not retrieve the label.

if you know the control id maybe try "Control.GetLabel":

https://kodi.wiki/view/InfoLabels#Control
Reply
#6
hi,

now i tested a little bit, but with no 100% luck...

case 1:
---------
xml:
<control type="edit" id="55">
<label>$INFO[Window.Property(searchcriteria)]</label>

python:
xbmcgui.Window(xbmcgui.getCurrentWindowId()).setProperty('searchcriteria','fakenews')
...
searchcriteria = xbmcgui.Window(xbmcgui.getCurrentWindowId()).getProperty('searchcriteria')

-> i can read the value i have written before

case 2:
---------

xml:
<control type="edit" id="55">
<label>fakenews</label>

python:
suchkriterien = xbmcgui.Control.getLabel(55)

-> 'xbmcgui.Control' has no attribute 'getLabel'
Reply
#7
sorry, forgot to say:

the value that i could write/read in case 1 is not the value which i enter in the ui ;-(
Reply

Logout Mark Read Team Forum Stats Members Help
getting a edit control label from python script0
This forum uses Lukasz Tkacz MyBB addons.