On 05/15/11 16:19, Osmo Salomaa wrote:
> su, 2011-05-15 kello 15:31 -0600, John Haiducek kirjoitti:
>> That had occurred to me, but I was hoping there was a simpler way
>> (unless it's not so complicated as I thought to figure out which
>> coordinates are inside the cell).
> Tree view's 'row-activated' will send the path and column as arguments
> to the callback. With 'cursor-changed' you just need to call
> gtk.TreeView.get_cursor to find out the path and column. With
> gtk.Widget's 'button-press-event' you get the event as an argument for
> the callback and you just need to call gtk.TreeView.get_path_at_pos with
> event.x and event.y to get the path and column.
>
> I don't know if that's easier than some alternative, but it's no more
> than two or three lines of code in a callback. I vaguely remember using
> gtk.GenericCellRenderer being difficult and there's a good chance of
> breakage with new versions of GTK+ if you have to write the rendering
> etc. code yourself -- I stumbled on this a couple times. Can you get the
> 'on-activate' signal if you subclass gtk.CellRendererPixbuf?

Ah, thanks...that will save me the trouble of writing my own rendering
code. No, gtk.CellRendererPixbuf has no on-activate signal...it appears
the only way to do this from the cell renderer itself is by subclassing
gtk.GenericCellRenderer.
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to