The following is a small program which does what you describe (you should really post a small example code which exhibits your problem!). I'm sorry - it's in Python - but it should be similar enough for you. Note:
can_focus
has no effect here (in fact, it's probably on by default)
- you have to enable the correct renderer's 'editable' (which I believe you did)
- you have to connect a handler to the renderer's 'edited' signal, and take care of updating the store yourself.
Listing:
from gi.repository import Gtk
class MainWindow(Gtk.Window):
def __init__(self):
super(MainWindow, self).__init__()
self.set_size_request(150, 60)
self.connect("destroy", lambda x: Gtk.main_quit())
store = Gtk.ListStore(str, str)
view = Gtk.TreeView(model = store)
for i, hdr in enumerate(("Col1", "Col2")):
if i == 1:
renderer = Gtk.CellRendererText(editable = True)
renderer.connect("edited", self.on_edited)
else:
renderer = Gtk.CellRendererText()
col = Gtk.TreeViewColumn(hdr, renderer, text = i)
view.append_column(col)
store.append(("One", "Two"))
self.add(view)
self.show_all()
def on_edited(self, renderer, path, new_text):
print(" Modify the store here [edited text: %s]" % new_text)
def run(self):
Gtk.main()
def main(args):
mainwdw = MainWindow()
mainwdw.run()
return 0
if __name__ == '__main__':
import sys
sys.exit(main(sys.argv))
Initial window:
Click on col2:
Edited:
Print from handler: