[pygtk] Cancel editing on a gtk.CellRendererText
Seth Mahoney
smahoney at pdx.edu
Thu Jul 17 05:06:54 WST 2008
Hi,
I've got a TreeView that displays different kinds of data -
basically book citations and plain text - in a sort of outline
format. I'd like the plain text to be editable, and the book
citations to be noneditable, but I can't seem to figure out how to
cancel editing. The first column of my TreeModel contains the text to
be displayed, and the second column contains xml data, which isn't
displayed, but is used for a variety of purposes, including
identifying the type of data. The callback correctly prints "called!"
when I try to edit a citation, but doesn't cancel the edit. I've also
tried calling editing_canceled(), but that doesn't work either.
Here's what my callback, connected to "editing-started", looks like
right now:
def outline_edit_start_cb(self, cell, editable, path, model):
my_iter = model.get_iter_from_string(path)
if model.get_value(my_iter, 1).tag == "cite":
print "called!"
cell.stop_editing(True)
return True
return False
Any help would be appreciated.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080716/d360a34d/attachment.htm
More information about the pygtk
mailing list