[pygtk] Custom cell renderers
Gustavo J. A. M. Carneiro
gjc at inescporto.pt
Fri Apr 8 18:19:07 WST 2005
On Fri, 2005-04-08 at 02:21 +0300, Osmo Salomaa wrote:
> I've been reading some old posts on the list about problems with
> creating custom cell renderers.
>
> After those posts has happened the following:
>
> "ANNOUNCE: PyGTK 2.6.0
> ...
> GInterfaces can now be implemented.
> Overriding GTK+ virtual methods is now supported."
>
> If I understood correctly these two were the reasons why one couldn't
> subclass CellRendererText and override the 'start_editing' method or use
> a TextView that implements CellEditable as the editing widget in a
> custom cell renderer? Can these tasks now be done?
It depends. The two statements are a bit optimistic :-)
It means the infrastructure is there to implement interfaces and
override gtk+ virtual methods. However, some interface and virtual
method "proxies" cannot be automatically generated (yet) and need manual
coding, thus not all proxies have been implemented, which means you have
to check, case by case, if what you want to do is possible.
In your specific case, yes, you can implement GtkEditable interface.
To do so, you have to add gtk.Editable to base classes, and implement
the interface methods. For each interface method <foo>, you have to
implement a corresponding method do_<foo> in your class. Then call
gobject.type_register(MyClass).
Regards.
--
Gustavo J. A. M. Carneiro
<gjc at inescporto.pt> <gustavo at users.sourceforge.net>
The universe is always one step beyond logic.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3086 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20050408/40e796a2/smime.bin
More information about the pygtk
mailing list