Multiline popup
#1
I try to display a multiline popup while i play a movie.

I read the wiki and found a script but i get some errors and i'm not good in phyton. Can someone take a look what's wrong?
Code:
import xbmcgui
import sys
import urlparse

class PopupWindow(xbmcgui.WindowDialog):
    def __init__(self, image, line1, line2, line3, line4, line5):
        self.addControl(xbmcgui.ControlImage(x=25, y=25, width=150, height=150, filename=image[0]))
        self.addControl(xbmcgui.ControlLabel(x=190, y=25, width=500, height=25, label=line1[0]))
        self.addControl(xbmcgui.ControlLabel(x=190, y=50, width=500, height=25, label=line2[0]))
        self.addControl(xbmcgui.ControlLabel(x=190, y=75, width=500, height=25, label=line3[0]))
        self.addControl(xbmcgui.ControlLabel(x=190, y=100, width=500, height=25, label=line4[0]))
        self.addControl(xbmcgui.ControlLabel(x=190, y=125, width=500, height=25, label=line5[0]))

if __name__ == '__main__':
    params = urlparse.parse_qs('&'.join(sys.argv[1:]))
    window = PopupWindow(**params)
    window.show()
    xbmc.sleep(5000)
    window.close()
    del window
I get these error and i have no clue how to solve
Code:
23:26:28 T:3148   ERROR: Control 50 in window 10001 has been asked to focus, but it can't
23:26:28 T:2592   ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
                                             - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
                                            Error Type: <type 'exceptions.TypeError'>
                                            Error Contents: __init__() got an unexpected keyword argument '?image'
                                            Traceback (most recent call last):
                                              File "C:\Program Files (x86)\XBMC15\portable_data\addons\script.popup\default.py", line 16, in <module>
                                                window = PopupWindow(**params)
                                            TypeError: __init__() got an unexpected keyword argument '?image'
                                            -->End of Python script error report<--
I changed the line to window = PopupWindow('c:\\temp.png','test1','test2','test3','test4','test5')
Now i have no script errors but i see no popup window but an empty file dialog and at the top of the screen the first letter of every line and no picture.

Can somebody help?
Reply

Logout Mark Read Team Forum Stats Members Help
Multiline popup0