import gtk, gobject

ls = gtk.ListStore(gobject.TYPE_STRING)
ls.append(("test1",))
ls.append(("test2",))
ls.append(("test3",))

def edited(r, path, new_text, ls):
    ls[path][0] = new_text

crt = gtk.CellRendererText()
crt.props.editable = True
crt.connect("edited", edited, ls)

tv = gtk.TreeView(ls)
tv.props.headers_visible = False
tv.insert_column_with_attributes(0, '', crt, text=0)

sw = gtk.ScrolledWindow()
sw.add(tv)
sw.props.shadow_type = 'in'
sw.props.hscrollbar_policy = 'never'
sw.props.vscrollbar_policy = 'automatic'
sw.show_all()

d = gtk.Dialog(title='Edit Strings', buttons=(gtk.STOCK_OK, gtk.RESPONSE_ACCEPT))
d.props.has_separator = False
d.vbox.props.border_width = 12
d.vbox.pack_start(sw)
d.run()

for row in ls:
    print row[0]
