Re: Sorting a TreeModel
- From: Murray Cumming <murrayc murrayc com>
- To: Joe Van Dyk <joevandyk gmail com>
- Cc: gtkmm-list gnome org
- Subject: Re: Sorting a TreeModel
- Date: Thu, 11 Jan 2007 12:26:21 +0100
On Wed, 2007-01-10 at 12:20 -0800, Joe Van Dyk wrote:
> In my TreeModel, I have a bunch of floats. When these floats are
> displayed in the TreeView, they should be rounded to two or three
> decimal places. You should be able to sort on those columns as well.
>
> The TreeModel can contain about to 1000 rows or so, each row has 30
> columns. About half of those columns contain these floats. The
> TreeModel is updated at least once a second. So, performance might be
> an issue.
[snip]
The TreeView::append_column_numeric() and
TreeView::append_column_numeric_editable() convenience functions:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1TreeView.html#e6fc0051cc178bfacea2dec27c2d5a58
allow you to specify a printf-style format, though you can do this
yourself with a set_cell_data_func() callback. The formatting would only
happen for visible columns, not all columns, so it shouldn't be a
performance problem. Then again, updating once a second is quite
unusual.
--
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]