XBMC Community Forum  

Go Back   XBMC Community Forum > Development > Plugin/Script (Python) Development

Plugin/Script (Python) Development Developers forum for XBMC Python Plugins/Scripts. Scripters/coders only!
Not for posting feature requests, bugs, or end-user support requests!

Reply
 
Thread Tools Search this Thread Display Modes
Old 2004-04-12, 08:29   #1
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

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:

Quote:
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:

Quote:
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?
madtw is offline   Reply With Quote
Old 2004-04-12, 15:40   #2
darkie
Team-XBMC Developer
 
Join Date: Sep 2003
Posts: 530
darkie is on a distinguished road
Default

Quote:
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.
Quote:
just out of curiosity which version of the python interpreter is embedded in xbmc?
2.3
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


darkie is offline   Reply With Quote
Old 2004-04-12, 18:11   #3
darkie
Team-XBMC Developer
 
Join Date: Sep 2003
Posts: 530
darkie is on a distinguished road
Default

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.
__________________
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


darkie is offline   Reply With Quote
Old 2004-04-13, 02:52   #4
madtw
Senior Member
 
Join Date: Mar 2004
Posts: 174
madtw is on a distinguished road
Default

thanks darkie... i thought i was going crazy.
madtw is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
question on Classes and closing windows Livin Plugin/Script (Python) Development 4 2006-02-02 18:50
New Bug... xbmcgui.ListItem ? Livin Plugin/Script (Python) Development 7 2006-01-17 02:26
Where is xbmc.py and xbmcgui.py earney Plugin/Script (Python) Development 2 2005-07-29 10:02
Xbmcgui controllist() hibaby XBMC for Xbox Specific Support 0 2005-07-24 18:59
xbmc and xbmcgui? No0ne Plugin/Script (Python) Development 1 2004-04-10 15:13


All times are GMT +2. The time now is 21:34.


Protected by Akismet, We recommend WordPress blogs
Copyright © 2008, XBMC Project