[pygtk] ComboBox Unresponsive with Custom CellRenderer

Bradlee Landis bradleelandis at gmail.com
Thu Dec 23 01:35:35 WST 2010


I have implemented a custom CellRenderer in PyGTK that can take longer
to render than is ideal. There can be multiple images that have to be
scaled, so when the user clicks on the ComboBox, it won't even show
the popup until the rendering is completed. If I can show the popup,
and then render the image, that would be fine. My code is currently at
http://code.google.com/p/exposong/source/browse/lib/exposong/themeselect.py.

I have implemented caching, so that after it loads the first time, it
will load from a single image from memory or disk, but the first time
it loads can take 2-4 seconds per cell.

The things that I have thought of implementing, include, pop up the
combobox when the application loads, so that it forces it to render
the image. This does not seem to be working in the tests I have run.

I have also tried to create a CairoContext and surface that is not
visible, but I require it to be a gtk.gdk.CairoContext, which I don't
think can be initiated without an actual widget. There's a possibility
that I could render this in a widget offscreen, but I'm not sure if
that's a good idea, or even possible.



I hope I can get more support than I have in the past.

-- 
Thanks,
Brad Landis


More information about the pygtk mailing list