RE: [PHP-GTK] Get sort type of CList
| From: | Christian Weiske | Date: | Tue, 18 Nov 2003 17:31:58 +0000 |
| Subject: | RE: [PHP-GTK] Get sort type of CList | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-4178@lists.php.net to get a copy of this message | ||
Hi
> I know there is a method called set_sort_type(), but I can't
> find one like: get_sort_type(). Anyone got any suggestions?
IMHO there is no function like this.
At the start, there is no sorting.
Then you've got to store the sort order when the click_column event
occurs:
$this->arWidgets["ctreeClasses"]->connect("click_column" , array(
&$this, "onCListClickColumn"));
/**
* the user wants to sort the list (he clicked on the header)
*/
function onCListClickColumn( $clist, $column)
{
if( $column == $clist->sort_column)
{
if ($clist->sort_type == GTK_SORT_ASCENDING) {
$clist->set_sort_type(GTK_SORT_DESCENDING);
} else {
$clist->set_sort_type(GTK_SORT_ASCENDING);
}
} else {
$clist->set_sort_column($column);
}
$clist->sort();
}//function onCListClickColumn( $clist, $column)
Regards/MfG,
Christian Weiske
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>
Christian Weiske
cweiske@cweiske.de
www.cweiske.de
<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>
Always forgetting birthdays? Try birthday reminder!
http://www.cweiske.de/birthday.htm