![]() |
![]()
| ![]() |
![]()
NAMEGtk2::TreeSortable - wrapper for GtkTreeSortable HIERARCHYGlib::Interface +----Gtk2::TreeSortable METHODS$sortable->set_default_sort_func ($sort_func, $user_data=undef)
boolean = $sortable->has_default_sort_func$sortable->sort_column_changed(sort_column_id, order) = $sortable->get_sort_column_idReturns sort_column_id, an integer and order, a Gtk2::SortType. $sortable->set_sort_column_id ($sort_column_id, $order)
$sortable->set_sort_func ($sort_column_id, $sort_func, $user_data=undef)
IMPLEMENTING THE GtkTreeSortable INTERACEIf you want your custom tree model to be sortable, you need to implement the GtkTreeSortable interface. Just like with other interfaces, this boils down to announcing that your subclass implements the interface and providing a few virtual methods. The former is achieved by adding "Gtk2::TreeSortable" to the "interfaces" key. For example: package MyModel; use Gtk2; use Glib::Object::Subclass Glib::Object::, interfaces => [ Gtk2::TreeModel::, Gtk2::TreeSortable:: ], ; The virtual methods you need to implement are listed below. VIRTUAL METHODSThese virtual methods are called by perl when gtk+ attempts to modify the sorting behavior of your model. Implement them in your model's package. Note that we don't provide a wrapper for sort_column_changed because there is a signal for it, which means you can use the normal signal overriding mechanism documented in Glib::Object::Subclass.
SIGNALSENUMS AND FLAGSenum Gtk2::SortType
SEE ALSOGtk2, Glib::Interface COPYRIGHTCopyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice.
|