I am trying to get the following code: Two columns have one item id in one, another has a type id and I render itemid To do this, only when typeId is equal to a specific value
class IDRenderer (gtk.CellRendererText) :. Def __init __ (self): gtk.CellRendererText .__ init __ (self) def do_render (self, window, widget, background_area, cell_area, expose_area, flags): if ----} ask for the value of the status typeId - Cell {-----: gtk.CellRendererText.do_render (auto, window, widget, background_area, cell_area, expose_area, flags) gobject.type_register (IDRenderer) How do I presently Do not know the lines provided to get the ITER which I need to determine the value of typeId. Is this also possible?
I now know, thanks to a good man at #pygtk on gimpirc:
You can do this, to do this example in the form of so called binding cell data functions to gtk.TreeViewColumn
with DEF renderId (celllayout, cell, model done here, with ITER ): If model.get_value (ITER, 1) == 3: cell.set_property ('view', this is true) and: cell.set_property ('view', false) treeviewcolumn = gtk.TreeViewColumn () renderer = gtk. CellRendererText () treeviewcolumn.add_attribute (renderer, 'text', 0) treeviewcolumn.set_cell_data_func (render , RenderId) I have a whole Treeview Ommited relevant some code to render, but I think that I want to do it shows what and how to do it.
The model presents the value in the first column (0) of the model, if only the second model's column (1) is equal to 3
I hope that this is some time Can help.
Comments
Post a Comment