On Wed, 2003-12-31 at 16:06, David M. Cook wrote: > On Tue, Dec 30, 2003 at 10:14:19PM +0100, Daniel Kirkegaard Mouritsen wrote: > > Hey everybody, > > > > I'm having problems with the gtk.CellRendererToggle() renderer, I have a > > TreeStore with three column defined like this: > > > > tree_store = gtk.TreeStore(gobject.GObject, gobject.TYPE_STRING, > > gobject.TYPE_STRING) > > You need a gobject.TYPE_BOOLEAN for the toggle buttons unless you are using > TreeViewColumn.set_cell_data_func(). > > > Ive connected the "toggled" signal to a function, but when i > > activate/deactivate the toggle it applies the changes to all the > > toggles. > > What does your callback look like?
Hi there, I think its safe to say I had misunderstood how the TreeView widget really worked, so.. I dont wanna show you :D I got it working now though, by using gtk.TYPE_BOOLEAN and then using syntax ala: column = gtk.TreeViewColumn(None, toggle_renderer, active=0) Then i bound the "toggled" signal to a function which updates a array with info about what rows are selected clears and refills the contents of the treeview. I don't know if this is the most elegant solution (I'm very noobish with both python and gtk. I usually work with c++/SDL/OpenGL, but figured that i needed to learn to do toolkit based apps sometime. And I always wanted to learn python, since everybody tells me how well it integrates with C++), but it works as intended. -daniel PS. Happy new year =) > > Dave Cook > _______________________________________________ > pygtk mailing list [EMAIL PROTECTED] > http://www.daa.com.au/mailman/listinfo/pygtk > Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/ _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/
