Use a text column (Glib::ustring type will do just fine), and a CellRendererText (see here: http://gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1CellRendererText.html), and use a CellDataFunc (Gtk+ term) to display the data as a string after preprocessing it in the cell-data function (see here for CellDataFunc: http://gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeViewColumn.html#765296845c9e9757ba405becbbc13d96 )
You could use e.g. boost::format to display either "true" or "false" for a bool, display an int as string using %d, display a string as the string itself (don't forget to make sure it's UTF-8 encoded for display), etc.. Milosz On 12/17/06, German Diago Gomez <[EMAIL PROTECTED]> wrote:
Hello. I want to use a treeview with a liststore to show Properties of objects I create at runtime. The ModelColumns has two columns. The first one is always a Glib::ustring and displays the name of a property for an object. There's no problem there. But the second column is variable. I can show either an int, a float, a string or a bool. And I'd like to be able to show all the properties in the same treeview, namely, with a Name and a Value column in the treeview, but the Value Column is variable in its type. How could I get this behaoviour? Thanks in advance. _______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
_______________________________________________ gtkmm-list mailing list [email protected] http://mail.gnome.org/mailman/listinfo/gtkmm-list
