mandel
mandel

Reputation: 2947

Creating a custom GtkCellRenderer with PyGobject

I'm in the process of writing a Gtk application. Up 'til know I have been using pygtk but because that has been deprecated in favor of PyGobject I have decided to make the switch. Back in the time of pygtk one could extend the gtk.GenericCellRenderer but this class is not longer present.

I have tried to find examples in python that uses the new API but I have failed. Can anyone show an example of a custom cell renderer that I could use as a starting point?

Upvotes: 4

Views: 647

Answers (1)

eagleoneraptor
eagleoneraptor

Reputation: 1227

Apparently Gtk+ does not have any class called GtkGenericCellRenderer, is PyGtk exclusive. Since PyGObject binding is virtually the same than the C API, because the introspection technology, I suggest to use GtkCellRenderer, present in Gtk+.

from gi.repository import Gtk

class MyCellRenderer(Gtk.CellRenderer):
    def __init__(self):
        Gtk.CellRenderer.__init__(self)

Upvotes: 1

Related Questions