PSA: The forum server will be physically migrated to a new datacenter. Expect a large downtime of the forum between the 27th and the 29th of September.

Displaying a python list

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
reaven Offline
Skilled Skinner
Posts: 1,312
Joined: May 2009
Reputation: 22
Brick  Displaying a python list
Post: #1
I've been cracking my head on this one, writing an script I have a python function that returns a list, all working since i can get it to display on the console but I want to display it on the bottom of the
Code:
fullscreenvideo-WINDOW_FULLSCREEN_VIDEO
based on a button press in the
Code:
playercontrols-WINDOW_DIALOG_PLAYER_CONTROLS
but cant figure how to interact with the gui from python

clearArt Concept
cdArt Concept

*If like, thank user
find quote
ronie Offline
Team-Kodi Member
Posts: 13,237
Joined: Jan 2009
Reputation: 395
Post: #2
python can communicate with the gui through window properties.
so that might be a possible solution?

if you want to display stuff on the fullscreen videowindow,
remember to use id="1" for all the controls you add,
else it won't show up on screen.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
reaven Offline
Skilled Skinner
Posts: 1,312
Joined: May 2009
Reputation: 22
Post: #3
well thats where i get lost.
Been trying,I dont know if you mean something like
Code:
myVar = function****
xbmcgui.Window(12005).setProperty( 'MyProperty' ,  myVar)
and
Code:
<control type="label" id="1">
<description>Text to display</description>
<label>$INFO[Window(12005).Property(MyProperty)]</label>
etc...
</control>
I cant connect those two concepts, dont know why Frown

clearArt Concept
cdArt Concept

*If like, thank user
find quote
ronie Offline
Team-Kodi Member
Posts: 13,237
Joined: Jan 2009
Reputation: 395
Post: #4
works fine on my end.

here's the test script i used:
Code:
import xbmcgui

myVar = 'world'
xbmcgui.Window(12005).setProperty( 'MyProperty' ,  myVar)

and this is the label i've placed at the bottom of VideoFullScreen.xml:
Code:
            <control type="label" id="1">
                <posx>0</posx>
                <posy>0</posy>
                <width>600</width>
                <height>25</height>
                <label>hello: $INFO[Window(12005).Property(MyProperty)]</label>
                <font>font13</font>
                <textcolor>white</textcolor>
            </control>

the exact same code should work on your end as well.
might be a good starting point to track down why your code doesn't work.

Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ and Search the forum before posting.
For troubleshooting and bug reporting please make sure you read this first.
find quote
reaven Offline
Skilled Skinner
Posts: 1,312
Joined: May 2009
Reputation: 22
Post: #5
well is exactly what I have so I am in the correct path.
What caught my attention is the VideoFullScreen.xml file you add the control to, i am adding the control to name.xml inside my resources/skins/Default/720p/ , folder

That have something to do ?

my file name.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<window>
    <controls>
        <control type="label" id="1">
                <posx>0</posx>
                <posy>0</posy>
                <width>600</width>
                <height>25</height>
                <label>$INFO[Window(12005).Property(MyProperty)]</label>
                <font>font13</font>
                <textcolor>white</textcolor>
        </control>
    </controls>
</window>

and to test I add some logs to debug in the console
Code:
import xbmcgui

myVar = 'test_label'
print ('playback started')
xbmcgui.Window(12005).setProperty( 'MyProperty' ,  myVar)
print ('way past what I am suppose to display')

*in fact if I add the control to the existing VideoFullScreen.xml it shows. soo How I add that to my own xml inside my addon ?

clearArt Concept
cdArt Concept

*If like, thank user
(This post was last modified: 2015-07-22 20:06 by reaven.)
find quote
reaven Offline
Skilled Skinner
Posts: 1,312
Joined: May 2009
Reputation: 22
Post: #6
Maybe is something the skinners have to implement from their side and i cant set it from mine(addon side), I could also try and create the controls directly from python with something like
Code:
class ControlLabel(Control)
don't know if that could work.

BTW, Thanks a lot Ronie Big Grin !

clearArt Concept
cdArt Concept

*If like, thank user
find quote