[pygtk] treeview with gtk.Button()

Brian dol-sen at telus.net
Fri Nov 11 10:44:28 WST 2005


oops, I missed cc'ing this list

On Thu, 2005-10-11 at 12:46 +0100, Alessandro Ferrarin wrote:
> Do you know a simple way to add a gtk.Button() into a gtk.TreeView ?
> Is this possible or I need to extend a gtk.GenericCellRender ?
> 
> Grazie.
> 

Here is two code snips from our app that puts a checkbox in the
treeview.

        # add checkbox column
        self._checkbox_column = gtk.TreeViewColumn()
        self._checkbox_column.set_resizable(False)
        self.append_column(self._checkbox_column)


            # add the toggle renderer
            check = gtk.CellRendererToggle()
            self._checkbox_column.pack_start(check, expand = False)
            self._checkbox_column.add_attribute(check, "active", 1)
            check.connect("toggled",self.on_toggled)
            self._checkbox_column.set_visible(True)

A gtk.Button() should be similar.

-- 
Brian <dol-sen at telus.net>



More information about the pygtk mailing list