Re: TreeView::append_column_numeric() format?
- From: Carl Nygard <cjnygard fast net>
- To: Murray Cumming <murrayc murrayc com>
- Cc: pks timing com, gtkmm-list <gtkmm-list gnome org>
- Subject: Re: TreeView::append_column_numeric() format?
- Date: Mon, 06 Dec 2004 16:48:15 -0500
On Mon, 2004-12-06 at 13:52, Murray Cumming wrote:
> On Tue, 2004-11-23 at 10:23 +0100, Murray Cumming wrote:
> > I think I'll allow a sprintf-style format string,
>
> I've done that now, in gtkmm 2.5. When parsing data in editable cells,
> it only understand decimal numbers, but I don't think that's a huge
> disadvantage.
>
> I'd welcome any criticism.
The problem with relying on purely sprintf-style formatting is you're
missing the localization provided by the streams classes (unless *I'm*
missing something).
And if you want to parse the numbers, again streams would be the logical
choice in C++.
That's why I was suggesting something akin to the lexical_cast<>
templates I have available. They are easily extensible to include input
as well as output, so would provide a natural bridge between text
representation and float/complex/etc. data values, and even extend to
other data types like dates, money, etc.
I use something similar in the libsimple/libgtklink libraries (also
available, I believe) which provide simplified interface/link between
data vars and widgets. In particular, I have a translation class used
with the entry fields to provide translation to/from the Gtk::Text
widget.
Regards,
Carl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]