Start PyGTK cellrenderer edit from code
Posted
by mkotechno
on Stack Overflow
See other posts from Stack Overflow
or by mkotechno
Published on 2010-04-05T01:03:08Z
Indexed on
2010/04/05
1:13 UTC
Read the original article
Hit count: 348
I have a treeview with an editable CellRendererText:
self.renderer = gtk.CellRendererText()
self.renderer.set_property('editable', True)
But now I need to launch the edition from code instead from user, this is to focus the user attention in the fact he just created a new row and needs to be named. I tried this but does not work:
self.renderer.start_editing(
gtk.gdk.Event(gtk.gdk.NOTHING),
self.treeview,
str(index),
gtk.gdk.Rectangle(),
gtk.gdk.Rectangle(),
0)
Neither does not throw errors, but the documentation about for what is each argument is not clear, in fact I really don't know if start_editing method is for this.
All suggestions are welcome, thanks.
© Stack Overflow or respective owner