Re: How to use GtkTreeSortable.



On Tue, 22 Oct 2002 10:08:34 +0300
Olexiy Avramchenko <ath beast stu cn ua> wrote:

As I think there's a file size column in your tree model (of type G_TYPE_INT
or so). All you need is to call gtk_tree_view_column_set_sort_column_id()
on that column.

enum {
<skipped>
  COLUMN_FILE_SIZE,
<skipped>
};

<skipped>
{
GtkTreeViewColumn *column;
<skipped>
    column = gtk_tree_view_column_new_with_attributes(...);
    gtk_tree_view_column_set_sort_column_id (column, COLUMN_FILE_SIZE)
<skipped>
}

Olexiy

Hello.
I have a file size column of type G_TYPE_STRING and displays the
file size like 3.3 MB, 454 Kb, 544 B etc.

I am currently using gtk_tree_view_set_sort_column_id, but the sort
function sorts the size in alphabetic order, which is incorect
for this column.

I need to build my own method to sort this column. Do you know
how gtk_tree_sortable_set_sort_func() works?

/Johan



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