2015-07-28, 08:31
Hello,
i am developing an addon for kodi and am having some trouble with one aspect of it. First of all the addon im developing is a dab radio gui for the monkeyboard development board and since im very new to using python i just cant understand why in a thread i have created, it will not print a label or image on the screen but i goes through it in the log.
for example my program goes as such:
class Updatethread(threading.Thread, xbmcgui.WindowDialog):
def run(self):
import xbmcgui
self.shutdown = False
while self.shutdown == False:
print 'Thread Started'
stationtext(self)
sleep(30)
def stationtext(self):
startstation = open(stationspath + 'startstation.txt','r').read()
program = radio.programs[int(startstation)]
print 'Getting Program info'
if radio.status != -1:
text = program.text
if text != None:
print 'printing Program info'
print text
print 'Printing info background...'
self.addControl(xbmcgui.ControlImage(380, 145, 912, 44, mediaPath + "text_background.png"))
print 'Printing info...'
self.addControl(xbmcgui.ControlLabel(400, 142, 880, 50, program.text, textColor='0xffffffff',alignment=TEXT_ALIGN_LEFT,font='font35_title'))
thanks in advanced
Cyklon
i am developing an addon for kodi and am having some trouble with one aspect of it. First of all the addon im developing is a dab radio gui for the monkeyboard development board and since im very new to using python i just cant understand why in a thread i have created, it will not print a label or image on the screen but i goes through it in the log.
for example my program goes as such:
class Updatethread(threading.Thread, xbmcgui.WindowDialog):
def run(self):
import xbmcgui
self.shutdown = False
while self.shutdown == False:
print 'Thread Started'
stationtext(self)
sleep(30)
def stationtext(self):
startstation = open(stationspath + 'startstation.txt','r').read()
program = radio.programs[int(startstation)]
print 'Getting Program info'
if radio.status != -1:
text = program.text
if text != None:
print 'printing Program info'
print text
print 'Printing info background...'
self.addControl(xbmcgui.ControlImage(380, 145, 912, 44, mediaPath + "text_background.png"))
print 'Printing info...'
self.addControl(xbmcgui.ControlLabel(400, 142, 880, 50, program.text, textColor='0xffffffff',alignment=TEXT_ALIGN_LEFT,font='font35_title'))
thanks in advanced
Cyklon