Re: Clist->set_reorderable
| From: | nathan | Date: | Thu, 29 Jan 2004 08:57:33 +0000 |
| Subject: | Re: Clist->set_reorderable | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4373@lists.php.net to get a copy of this message | ||
On 29 janv. 2004, you wrote in php.gtk.general:
> nathan@the-ring.homelinux.net wrote:
>> Hi,
>> i'm trying to find how to enable reorderable columns in clist, i
>> thought that set_reorderable will do the job, but it still doesn't
>> work under linux or windows.
>> Is someone know a way to do this?
>
> This does it for me.
>
> Attach this function to the click_column signal of the clist widget
> you need to be able to sort. It works ascending and descending
>
> function column_clicked($clist, $column){
> $current_sort_type = $clist->get_data('sort_type');
> $current_sort_column = $clist->get_data('sort_column');
> if ($current_sort_column == $column){
> if ($current_sort_type==GTK_SORT_ASCENDING){
> $sort_type = GTK_SORT_DESCENDING;
> }
> else {
> $sort_type = GTK_SORT_ASCENDING;
> }
> }
> else {
> $sort_type = GTK_SORT_ASCENDING;
> }
> $clist->set_sort_column($column);
> $clist->set_sort_type($sort_type);
> $clist->sort();
> $clist->set_data('sort_column', $column);
> $clist->set_data('sort_type', $sort_type);
> }
>
>
> Rgards
> Mike
Thanks, but i've no sorting problem,
what i want is to drag column 1 to column 3 for example.
I'm perferctly ok with sorting data on a column asc or desc with a
function similar to the one you've send, but still can't get my column
moving :'(
if somenone have an idea?
regards nathan