GNOME Bugzilla – Bug 102853
TreeView::append_column_editable for double or float causes compiler error
Last modified: 2004-12-22 21:47:04 UTC
Adding a column of type double or float with Gtk::TreeView::append_column_editable() causes a compiler error. Works ok for non-editable columns though. Example: class ModelColumns : public Gtk::TreeModel::ColumnRecord { public: ModelColumns(){add(m_col_d);} Gtk::TreeModelColumn<double> m_col_d; }; ModelColumns m_Columns; . . Gtk::TreeView m_TreeView; . . m_TreeView.append_column_editable("i", m_Columns.m_col_d); Error looks like this: /opt/gnome2/include/gtkmm-2.0/gtkmm/treeview.h: In method `void Gtk::TreeView::_auto_store_on_cellrenderer_text_edited_string<double>(const Glib::ustring &, const Glib::ustring &, int)': /opt/gnome2/include/gtkmm-2.0/gtkmm/treeview.h:1098: instantiated from `Gtk::TreeView_Private::_connect_auto_store_editable_signal_handler<double>(Gtk::TreeView *, Gtk::CellRenderer *, const Gtk::TreeModelColumn<double> &)' /opt/gnome2/include/gtkmm-2.0/gtkmm/treeview.h:914: instantiated from `Gtk::TreeView::append_column_editable<double>(const Glib::ustring &, const Gtk::TreeModelColumn<double> &)' test.C:156: instantiated from here /opt/gnome2/include/gtkmm-2.0/gtkmm/treeview.h:1044: `const class Glib::ustring' used where a floating point value was expected /opt/gnome2/include/gtkmm-2.0/gtkmm/treeview.h:1044: aggregate value used where a float was expected gmake: *** [test.o] Error 1 Thanks. Liza
Created attachment 13428 [details] [review] treeview_row_draggable.patch
I think that the patch (to 2.2.0) would do what you want, but I don't think we can add the template specializations without breaking ABI. However, I'll make the change from strtol to strtod - then you might be able to add the specializations in your own code. And if not, well the template code should show you how to do this with the normal append_column() method.