GNOME Bugzilla – Bug 89833
The appearance of the TreeStore example in gtk-demo (in gtkmm) differs from the example in gtk+
Last modified: 2004-12-22 21:47:04 UTC
I think the treestore example in gtkmm/demo/gtk-demo should look like the corresponding demo in the gtk+ distribution. In the Gtkmm example there are also toggle-cells on the rows there you have the months. In the Gtk+ example there are not toggle-cells on those rows. I have not managed to fix this. It seems like there "should be" one more function to append rows to the tree-store. The sample program uses: Gtk::TreeRow row = *(m_refTreeStore->append()); There should be some way to tell this function not to use all columns in my model... This may not be critical for functionality but it is critical for the user experience. Screenshot of Gtk+ sample program: http://bart.sm.luth.se/~dansun-8/gtk_treestore.png Screenshot of Gtkmm sample program: http://bart.sm.luth.se/~dansun-8/gtkmm_treestore.png I'm using gtkmm-1.3.18 and gtk+-2.0.5
See line 310 of gtk+/demos/gtk-demo/tree_store.c. They use an extra hidden "visible" column, which is linked to the CellRenderer's "visible" property. We need to do that too, by specifying a custom cell renderer, as described in the TreeView chapter. Tell me if you have any problems doing that.
This was indeed really simple to fix, just change row 305 in gtkmm/demos/gtk-demo/example_treeview_treestore.cc from: row[m_columns.visible] = true; to row[m_columns.visible] = false; I thought the visible attribute was used to determine if you could toggle the "toggle cell renderer". My mistake...
2002-08-05 Daniel <dss@home.se> * demos/gtk-demo/example_treeview_treestore.cc: toggle boxes are no longer shown in parent rows - there is a hidden boolea column that is associated with the visible attribute of the cell renderers.