After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 102853 - TreeView::append_column_editable for double or float causes compiler error
TreeView::append_column_editable for double or float causes compiler error
Status: RESOLVED FIXED
Product: gtkmm
Classification: Bindings
Component: TreeView
2.4
Other opensolaris
: Normal normal
: 3
Assigned To: gtkmm-forge
gtkmm-forge
Depends on:
Blocks:
 
 
Reported: 2003-01-08 16:45 UTC by Liza
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
treeview_row_draggable.patch (4.81 KB, patch)
2003-01-08 19:28 UTC, Murray Cumming
none Details | Review

Description Liza 2003-01-08 16:45:49 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
Comment 1 Murray Cumming 2003-01-08 19:28:32 UTC
Created attachment 13428 [details] [review]
treeview_row_draggable.patch
Comment 2 Murray Cumming 2003-01-08 19:30:13 UTC
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.