Re: Displaying domain objects with GtkTreeView



On 12/02/2011 03:55 PM, RafaÅ KrupiÅski wrote:
2011/12/1 David NeÄas <yeti physics muni cz>:
What are you talking about?  You can pass any GObject-derived type as
the column type (not that it matters much, the net result is the same as
passing G_TYPE_OBJECT).  You get back the objects that you stored there.

If you store objects of different classes to the same column and want to
know the precise type use RTTI: type macros such as MY_IS_FOO(),
G_TYPE_FROM_INSTANCE(), g_type_is_a(), etc.
Hi
I rather meant to use my object as a model for a whole, multi-column
row, somehow binding fields or properties to columns.
If you ave a collection of object of the same type you can do it. See
the code below:
http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/ui/edit/object-list-model.c?revision=3749&view=markup
<http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/ui/edit/object-list-model.c?revision=3749&view=markup>
http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/ui/edit/object-list-model.h?revision=3749&view=markup
<http://buzztard.svn.sourceforge.net/viewvc/buzztard/trunk/buzztard/src/ui/edit/object-list-model.h?revision=3749&view=markup>

Stefan
Regards




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]