Controllist.setimagedimensions causes xbmc crash
#1
i've been playing with the new python controllist functionality and adding thumbnails or icons to the control.  this seems to work fine.  however, i would like the images to show up larger so i call:

controllist.setimagedimensions( 50, 50 )

this causes the box to hang and the following entries in the xbmc log file:

04-04-2005 00:38:27 fatal exception_access_violation (0xc0000005)
at 0x0018a053
04-04-2005 00:38:27 fatal exception_access_violation (0xc0000005)
at 0x0018a053


any ideas on how i can make the images appear larger, like they would in the "big icons" views in videos and music?  the new little icon to the left of the text is nice, but i want nice big pictures.
Reply
#2
please give us the script so that we can reproduce and fix.
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.


Image
Reply
#3
i'm afraid this is a rather long and complicated script. but the relevant lines are as follows:

class windowdvd(xbmcgui.window):
def (self):
if emulating:
xbmcgui.window.(self)

self.scalex = ( float(self.getwidth()) / float(720) )
self.scaley = ( float(self.getheight()) / float(480) )

self.listdvds = xbmcgui.controllist(int(211*self.scalex), int(100*self.scaley), int(450*self.scalex), int(350*self.scaley))
self.listdvds.setimagedimensions( 30, 30 )
Reply
#4
i'm noticing that my calls to init are being dropped by the bulletin board software. really you just need to construct a list control and call setimagedimensions and it will crash. it's really that easy.
Reply
#5
the following code works fine in xbmc...

Quote:import os
import string
import xbmcgui

class window( xbmcgui.window ):
def ( self ):
xbmcgui.window.( self )

self.list = xbmcgui.controllist( 50, 100, 400, 300 )
self.addcontrol( self.list )
self.list.setimagedimensions( 30, 30 )
cwd = string.replace( os.getcwd(), ";", "" )
file = cwd + os.sep + "test.gif"
item = xbmcgui.listitem(
label="this is label1",
label2="label2 is here",
iconimage=file )
self.list.additem( item )

item = xbmcgui.listitem(
label="this is label1 for item 2",
label2="label2 is here for item 2",
iconimage=file )
self.list.additem( item )

def onaction( self, action ):
if action == 10:
self.close()

win = window()
win.domodal()

the problem you were having is that the gui control object is not allocated until addcontrol() is called. so if you call setimagedimensions() before addcontrol(), you will be trashing memory since the pointer has not been allocated yet. the setimagedimensions() method should really have some error checking on the pointer access... python coders shouldn't have to worry about the c++ implementation.

i can submit a patch sometime in the future when i get to adding keyword argument support to controllist objects... in the meantime the workaround is to issue your calls in the above order instead.

[edit] patch 1176789 submitted to fix this problem, to expose a few new parameters when constructing controllist objects, and to allow arg keys to be used when constructing controllist objects.
Reply
#6
Quote:patch 1176789 submitted
well done
Reply
#7
beautiful. thanks for the help.
Reply
#8
patch is now commited to cvs
Reply
#9
Smile
i love when it goes that way :
problem >> correction >> submition >> patch
Blush
Reply
#10
Hi,

I have implemented the same way you have mentioned. But still i get the small image icons. Please help.

self.list = xbmcgui.ControlList(200, 150, 300, 400)
self.addControl(self.list)
self.list.setImageDimensions(50, 50)
Reply
#11
Resurrection of an 11 year old thread! You are truly a necromancer wickey! Big Grin
Reply
#12
How much old it is, but still it is not working.
If you know any solution for this you could have share it rather than Big Grin
Reply
#13
You are quite right Sir, accept my apologies. :-)
Sadly I don't know enough to help you.
Reply

Logout Mark Read Team Forum Stats Members Help
Controllist.setimagedimensions causes xbmc crash0