Re: Treelist selection signal



On Sun, 2004-03-21 at 14:22, Carl Nygard wrote:
Is there a signal for when the user changes the selected row?  I must be
dense, but I don't know what it might be.  

The selection-related things are handled by a separate object, the
GtkTreeSelection:
http://developer.gnome.org/doc/API/2.0/gtk/GtkTreeSelection.html

You'll get a "changed" signal on the treeselection object each time the
selection changes.

  $treeview->get_selection->signal_connect (changed => sub {
          my $selection = shift;
          # for a multi-sel:
          my @paths = $selection->get_selected_rows;
          my $model = $selection->get_tree_view->get_model;
          ...
          # for single-sel
          my ($model, $iter) = $selection->get_selected;
          ...
  });


-- 
muppet <scott at asofyet dot org>




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]