Re: Gtk2::TreeView and friends: set_selectable()?
- From: muppet <scott asofyet org>
- To: Martin Junius <mj+gnome ml m-j-s net>
- Cc: gtk-perl-list gnome org
- Subject: Re: Gtk2::TreeView and friends: set_selectable()?
- Date: Sun, 3 Oct 2004 15:31:53 -0400
On Oct 3, 2004, at 3:05 PM, Martin Junius wrote:
In the progress of converting a CTree application to
TreeView/TreeStore I came across the following, where I haven't found
an answer to yet:
How do I make specific rows un-selectable? With CTree I'd be using
something like
$tree->node_set_selectable($node, 0);
Any ideas or hints?
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeSelection.html#gtk-
tree-selection-set-select-function
http://developer.gnome.org/doc/API/2.0/gtk/
GtkTreeSelection.html#GtkTreeSelectionFunc
translates to perl as:
$treeview->get_selection->set_select_function (\&selectable_filter);
sub selectable_filter {
my ($selection, $model, $path, $is_path_currently_selected) = @_;
# return true if the selection state can be toggled
return rand(10) > 5;
}
--
Without treatment, a common cold will last about seven days.
With treatment, it will last about a week.
-- conventional wisdom
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]