i have been trying to create my own classes that are derived from the xbmcgui control* classes. the reason for doing this is so that i can add in pixel height, width checking so that labels don't render outside of the control area. i have run into a problem... here is a high level overview of what i'm trying to do: Print Page - XBMC Scripts:: class myURLOpener(urllib.FancyURLopener): """ Subclass to override error 206 ( partial file addControl(xbmcgui.ControlImage(0,0720480, path.join(Root http://www.smdepot.net/forum/index.php?action=printpage;topic=2129.0HOME |
class label( xbmcgui.controllabel ):
...
label = label( x, y, w, h, text, font )
win.addcontrol( label )
the label class implements setlabel() and it does extra checking and formatting of the label so that it fits within the dimensions of the control before calling the xbmcgui.controllabel.setlabel() method. this all seems to work fine when i test against my stubbed out version of xbmc.py and xbmcgui.py using python 2.3.3. however, when the same code runs in xbmc, i get an error like the following in the xbmc.log:
11-04-2004 23:13:20 self.addcontrol( self.bgctl )
11-04-2004 23:13:20 <.recordedwin object at 0x006fd030>
11-04-2004 23:13:20 :
11-04-2004 23:13:20 object should be of type control
any ideas? is there a way to cast the instance down when calling addcontrol()? it seems like python does not realize that the class hierarchy is:
label is-a xbmcgui.controllabel is-a xbmcgui.control
just out of curiosity which version of the python interpreter is embedded in xbmc?
ok, there was a bug in the code when adding your own control type to a window.
but, the error you get was already fixed a few days ago.
with current cvs and your script, xbmc would just crash atm :d.
anyway, it is fixed now.
any ideas? *is there a way to cast the instance down when calling addcontrol()? *it seems like python does not realize that the class hierarchy is: seems like a bug in my implementation of addcontrol() :)
will try to fix it.
just out of curiosity which version of the python interpreter is embedded in xbmc? 2.3
thanks darkie... i thought i was going crazy. :)
Red Hat's Rough Recovery From CFO Exit
Windows Live Finds a New, Pre-installed Home
|