Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

gtk2::treesortable(3) [suse man page]

Gtk2::TreeSortable(3)					User Contributed Perl Documentation				     Gtk2::TreeSortable(3)

NAME
Gtk2::TreeSortable HIERARCHY
Glib::Interface +----Gtk2::TreeSortable METHODS
$sortable->set_default_sort_func ($sort_func, $user_data=undef) o $sort_func (scalar) o $user_data (scalar) boolean = $sortable->has_default_sort_func $sortable->sort_column_changed (sort_column_id, order) = $sortable->get_sort_column_id Returns sort_column_id, an integer and order, a Gtk2::SortType. $sortable->set_sort_column_id ($sort_column_id, $order) o $sort_column_id (integer) o $order (Gtk2::SortType) $sortable->set_sort_func ($sort_column_id, $sort_func, $user_data=undef) o $sort_column_id (integer) o $sort_func (scalar) o $user_data (scalar) IMPLEMENTING THE GtkTreeSortable INTERACE If 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 METHODS These 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. (is_not_special, id, order) = GET_SORT_COLUMN_ID ($model) Returns a boolean indicating whether the column is a special or normal one, its id and its sorting order. SET_SORT_COLUMN_ID ($list, $id, $order) Sets the sort column to the one specified by $id and the sorting order to $order. SET_SORT_FUNC ($list, $id, $func, $data) Sets the function that is to be used for sorting the column $id. SET_DEFAULT_SORT_FUNC ($list, $func, $data) Sets the function that is to be used for sorting columns that don't have a sorting function attached to them. The $func and $data arguments passed to these two methods should be treated as blackboxes. They are generic containers for some callback that is to be invoked whenever you want to compare two tree iters. When you call them, make sure to always pass $data. For example: $retval = $func->($list, $a, $b, $data); bool = HAS_DEFAULT_SORT_FUNC ($list) Returns a bool indicating whether $list has a default sorting function. SIGNALS
sort-column-changed (Gtk2::TreeSortable) ENUMS AND FLAGS
enum Gtk2::SortType o 'ascending' / 'GTK_SORT_ASCENDING' o 'descending' / 'GTK_SORT_DESCENDING' SEE ALSO
Gtk2, Glib::Interface COPYRIGHT
Copyright (C) 2003-2008 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.12.1 2010-07-05 Gtk2::TreeSortable(3)

Check Out this Related Man Page

Gtk2::ComboBoxEntry(3pm)				User Contributed Perl Documentation				  Gtk2::ComboBoxEntry(3pm)

NAME
Gtk2::ComboBoxEntry - A text entry field with a dropdown list SYNOPSIS
# the easy way $combo_box_entry = Gtk2::ComboBoxEntry->new_text; foreach (qw(one two three four five)) { $combo_box_entry->append_text ($_); } # or the powerful way. there always has to be at least # one text column in the model, but you can have anything # else in it that you want, just like Gtk2::ComboBox. $combo_box_entry = Gtk2::ComboBoxEntry->new ($model, $text_index); # to mess with with entry directly, get the child: $current_text = $combo_box_entry->child->get_text; DESCRIPTION
A ComboBoxEntry is a widget that allows the user to choose from a list of valid choices or enter a different value. It is very similar to a ComboBox, but displays the selected value in an entry to allow modifying it. The ComboBoxEntry has a Gtk2::Entry as its child. To get or set the currently-displayed text, just manipulate the entry normally. HIERARCHY
Glib::Object +----Glib::InitiallyUnowned +----Gtk2::Object +----Gtk2::Widget +----Gtk2::Container +----Gtk2::Bin +----Gtk2::ComboBox +----Gtk2::ComboBoxEntry INTERFACES
Glib::Object::_Unregistered::AtkImplementorIface Gtk2::Buildable Gtk2::CellLayout Gtk2::CellEditable METHODS
$entry = Gtk2::ComboBoxEntry->new $entry = Gtk2::ComboBoxEntry->new ($model, $text_column) o $text_column (integer) o $model (Gtk2::TreeModel) widget = Gtk2::ComboBoxEntry->new_text Since: gtk+ 2.4 $entry = Gtk2::ComboBoxEntry->new_with_model ($model, $text_column) o $text_column (integer) o $model (Gtk2::TreeModel) Alias for new, with two arguments. integer = $entry_box->get_text_column $entry_box->set_text_column ($text_column) o $text_column (integer) PROPERTIES
'text-column' (integer : default -1 : readable / writable / private) A column in the data source model to get the strings from SEE ALSO
Gtk2, Glib::Object, Glib::InitiallyUnowned, Gtk2::Object, Gtk2::Widget, Gtk2::Container, Gtk2::Bin, Gtk2::ComboBox COPYRIGHT
Copyright (C) 2003-2011 by the gtk2-perl team. This software is licensed under the LGPL. See Gtk2 for a full notice. perl v5.14.2 2012-05-27 Gtk2::ComboBoxEntry(3pm)
Man Page