On 25/09/2003 4:23 AM, David Moore wrote:

Is it possible for a TreeModel to tell a CellRendererToggle that it is
in an "in between" (inconsistent) state???

I have a TreeModel class derieved from GenericTreeModel.  Each node in
the tree can be in one of three states yes, no, or maybe.  Can a
CellRendererToggle show this or do I need a custom renderer?

e.g.
class MyModel(gtk.GenericTreeModel):
def on_get_value(self, node, column):
if column == 0:
return node.Yes_No_Maybe
elif column == 1: return gtk.TRUE
else:
raise AssertionError("no column %i" % column)


The gtk.CellRendererToggle has an "inconsistent" property, similar to the "active" property. If it is set to True, then the cell will display in the inconsistent state. You can either have a column in your model that maps to the inconsistent property, or use a cell data function to set the property based on some other condition.

The C documentation lists the properties:
   http://developer.gnome.org/doc/API/2.0/gtk/GtkCellRendererToggle.html

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to