[pygtk] ComboBox Unresponsive with Custom CellRenderer

Timo timomlists at gmail.com
Thu Dec 23 17:14:14 WST 2010


On 22-12-10 18:35, Bradlee Landis wrote:
> 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.
Without looking in depth to your code, maybe putting the following two 
lines after setting the long loading image could help. It will process 
any pending gtk events.

while gtk.events_pending()
     gtk.main_iteration()

Cheers,
Timo


> 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.
>



More information about the pygtk mailing list