471,602 Members | 1,274 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,602 software developers and data experts.

Editable lists in pygtk - Editing wrong cell

Hi all, i m trying to make an editable list with a toggle button, it
shows up and i can edit the list.. but its editing the wrong cell!

If i click on the toggle button on the first cell it sets FALSE on the
last cell of that row, if i change the text of the last cell if changes
another cell text... here is my code:

tree = self.principal.get_widget("file_list")
list = gtk.ListStore(str, str)
#Permite selecionar os arquivos
toggle = gtk.CellRendererToggle()
toggle.set_property('activatable', True)
tree.insert_column_with_attributes(-1, "Convert?", toggle)
toggle.connect('toggled', self.Select, tree)
#permite editar a lista
renderer = gtk.CellRendererText()
renderer.set_property( 'editable', True )
renderer.connect('edited', self.Edit, list)
tree.insert_column_with_attributes(-1, "Artist", renderer, text=0)
tree.insert_column_with_attributes(-1, "Song", renderer, text=1)
tree.set_model(list)

def Select(self,cell,path,model):
model[path][1] = not model[path][1]
return
def Edit(self, cell, path, new_text, model):
model[path][0] = new_text

What's wrong with it? i m following this example:
http://pygtk.org/pygtk2tutorial/sec-...tableTextCells

thanx in advance

Feb 25 '06 #1
0 1021

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

14 posts views Thread by Rod W | last post: by
1 post views Thread by wonil kim | last post: by
2 posts views Thread by Greg | last post: by
2 posts views Thread by Tim N. van der Leeuw | last post: by
1 post views Thread by Samuel Shulman | last post: by
1 post views Thread by planetthoughtful | last post: by
reply views Thread by =?Utf-8?B?UVNJRGV2ZWxvcGVy?= | last post: by
reply views Thread by leo001 | last post: by
reply views Thread by MichaelMortimer | last post: by
reply views Thread by CCCYYYY | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.