2008/4/26, Alessandro Dentella <[EMAIL PROTECTED]>:

>   i want to improve an editor of database tables I'm working on.  When
>   editing tables I use a TreeView with a ListStore and I use a <GType
>   gboolean> to store the data.
>
>   I'd like to add capability to handle IS NULL beside True and False ad that
>   is a different valuable choiche.

See, you need to define two bools in the TreeStore, one for thre real
True/False state, other for the Inconsistant state (I'm copying this
from an example, the complete code is here [1]).

        treestore = gtk.TreeStore(str, gobject.TYPE_BOOLEAN,
gobject.TYPE_BOOLEAN, str, gtk.gdk.Pixbuf)

Then, when you define the column:

        # create a TreeViewColumn for the checkbox
        tvcolumn = gtk.TreeViewColumn('Active')
        cell = gtk.CellRendererToggle()
        cell.set_property('activatable', True)
        cell.connect('toggled', self.activatePlugin)
        tvcolumn.pack_start(cell, False)
        tvcolumn.add_attribute(cell, 'active', 1)
        tvcolumn.add_attribute(cell, 'inconsistent', 2)
        self.append_column(tvcolumn)

Regards,

[1] 
http://w3af.svn.sourceforge.net/viewvc/w3af/branches/sasha/core/ui/gtkUi/pluginconfig.py

-- 
.    Facundo

Blog: http://www.taniquetil.com.ar/plog/
PyAr: http://www.python.org/ar/
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to