[pygtk] Re: renderer, style and drag-n-drop

Laurent G. lauranger at free.fr
Thu Jan 3 06:49:48 WST 2008


Laurent G. a écrit :
> Hi
> I managed to write a kind of ColorButtonCellRenderer trying to use
> Styles. No fully satisfying but quite functionnable until I set my
> TreeView row-reorderable. On dragging on_render get passed a pixmap
> instead of a window and the style methode "vomit" a :
> 
> TypeError: GtkStyle.paint_box() argument 1 must be gtk.gdk.Window, not
> gtk.gdk.Pixmap
> Traceback (most recent call last):
>   File "./mapcolorist.py", line 99, in on_render
>     cell_area.width,  cell_area.height)
> 
> Apart from mimic-ing style code for a drawable what are the options to
> face this trickage (illegal but legitimate in my mind) from drag-n-drop
> code ?
> 
> Thanks in advance for any advice or explanation.
> 
> Laurent G.
> 

After some readfing in CellRenderer I correct that the "trickage" is legal.
After reading gtk+ source I see that gtk_cell_renderer_text_render
uses gtk_paint_layout that waits a GdkWindow* giving it a GdkDrawable*
and it works fine. Would it be that the wrapper is stricter than gtk
itself ?

Have nice coding.

Laurent G.


More information about the pygtk mailing list