Skip to content

Help with a GenericCellRenderer using pygtk

I am trying to create a GenericCellRenderer to use for bookmarking items using a custom image of a pin instead of using the standard CellRendererToggle with a checkbox toggle.

http://pastebin.ca/1412757

Here is the code I wrote till now.

Now my problem is i want to detect if the cell is active or not. For that I want to use the property active and and self.active

I really would like to finish this for a the zeitgeist release! Please Help!

{ 2 } Comments

  1. Matthew Barnes | May 5, 2009 at 2:57 am | Permalink

    You should be checking the model, not the cell. Subclass a GtkCellRendererPixbuf, implement its activate() method, and bind its “visible” (or “sensitive”) property to a boolean column in your tree model. When the cell is activated, invert the corresponding column value.

    For a generic C-based example, see:
    http://git.gnome.org/cgit/gnome-video-arcade/tree/src/gva-cell-renderer-pixbuf.c

  2. Alfredo Sydnes | March 14, 2010 at 4:57 pm | Permalink

    I found your site via google. Very intressant I will continue to look around.

Post a Comment

Your email is never published nor shared. Required fields are marked *