Re: Sorting GtkListStore date column



Chris Vine wrote:

Obviously, I want to sort this in date sequence.  How do I accomplish
this?  I searched the archives before posting and couldn't find anything
applicable.  Thanks.

You can sort on a hidden column in the list store (that is, one not
displayed in a tree view) which has, say, this format:  YYYYMMDDSS


Sorry, that should of course be YYYYMMDDHHMMSS (expressed numerically).

Thanks, Chris and Fredderic for the suggestions. Fredderic, gCvs is is a desktop GUI to manage CVS repositories, so the date range for listed files can span multiple years. Hence, a day-of-the-week approach won't work.

I'll use the approach of storing the time_t corresponding to each displayed date in a hidden column, and use that hidden column as the sort column for the date column. Out of curiosity, would it also be possible to do this in a single column by storing just the time_t, and using a custom renderer to transform the time_t value into a displayable string? Is sorting done on the rendered text or on the underlying data?

--
Guy Rouillier



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]