Toggle button in a ListStore in pygtk, i cant make it work!

S

sapo

This is my code:

def list(self):
tree = self.principal.get_widget("list")
self.list = gtk.ListStore(bool,str)
self.options = [1,"programa1"]

renderer1 = gtk.CellRendererToggle()
renderer1.set_property('activatable', True)
renderer1.connect( 'toggled', self.selection, self.list)
tree.insert_column_with_attributes(0, "Select",renderer1)

renderer2 = gtk.CellRendererText()
tree.insert_column_with_attributes(1,"Install",renderer2, text=1)
self.list.append(self.options)
tree.set_model(self.list)

def selection( self, cell, path, model ):
model[path][0] = not model[path][0]
return

It shows up but the toggle button isnt working! what is wrong with
this?

I m following this example:

http://pygtk.org/pygtk2tutorial/sec-CellRenderers.html#sec-EditableActivatableProgram

Thanx for any help!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,139
Latest member
JamaalCald
Top