On 12/02/2011 04:01 PM, David Nečas wrote:
> On Fri, Dec 02, 2011 at 03:55:51PM +0100, Rafał Krupiński wrote:
>> I rather meant to use my object as a model for a whole, multi-column
>> row, somehow binding fields or properties to columns.
> It makes no sense (to me anyway) to imagine one object as multiple
> *model* columns.

Might be that what you look for, Rafal, is  model.set_modify_func () -
it allows him
to synthesize model columns on the fly, from e.g. objects in the real
model column.

The modify func then can look st. like this:

def modify_func (model, iter, col_num, attrs):
    obj = model.get_value (iter, 0)
    col = attrs[col_num]

    try:
        return getattr (obj, col)
    except:
        return ''

For some performance penalty.

Cheers,
Edheldil


_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to