[pygtk] catch key_press_event on gtk.CellRendererText (or gtk.TreeViewColumn)
Alessandro Dentella
sandro at e-den.it
Thu Mar 24 02:58:33 WST 2011
On Wed, Mar 23, 2011 at 06:59:24PM +0100, Giuseppe Penone wrote:
> Hi,
> I have a table with editable cells implemented with liststore+treeview in my
> application http://giuspen.com/cherrytree .
> I'm trying to connect a callback to any char inserted in a editable liststore
> cell but I cannot find a way since
>
> 1) when the user is inserting text in an editable liststore text cell the event
> is not catched from the treeview
It should not in fact. In that moment it's a gtk.Entry your widget and
that's the widgets that feels the events.
> 2) neither gtk.CellRendererText nor gtk.TreeViewColumn descend from a widget
> (but gtk.object instead).
no problem
> If anybody has an example to provide or a clue please help me.
> Thanks & best regards,
You can see [1] but it's probably a bit difficult to understand it at a
glance. The sense it that in the editing_started_cb the 'editable' var
contains the gtk.Entry, you can connect to that Entry to implement wahtever
you need.
sandro
*:-)
[1] http://hg.argolinux.org/py/sqlkit/file/b27e0a1085ef/sqlkit/widgets/table/columns.py#l457
--
Sandro Dentella *:-)
http://www.reteisi.org Soluzioni libere per le scuole
http://sqlkit.argolinux.org SQLkit home page - PyGTK/python/sqlalchemy
More information about the pygtk
mailing list