Re: Gtk2::SimpleList signal question

On Dec 7, 2005, at 8:29 PM, Sean Dague wrote:

I'm using a Gtk2::SimpleList to assign sounds for events in an application. I'd really like to know what signal is sent when the highlighted row is
changed via mouse click or keyboard (up / down).

The highlighted row is the "selected" row. Moving the highlight is "changing the selection". Therefore (ahem) the signal you want is "changed" on the treeview's selection, which is a Gtk2::TreeSelection.

    $treeview->get_selection->signal_connect (changed => sub {
        my ($selection) = @_;
# assuming you are in single or browse mode -- multisel is a bit different.
        my ($model, $iter) = $selection->get_selected;
        print "new selection is ".join(", ", $model->get ($iter))."\n";

row_activated is only for double click, which doesn't give me what we'd

Actually, row-activated is emitted for any form of activation of a row --- double-click with the mouse, or pressing the Enter or Space keys.

"Quit hittin' yourself!  Quit hittin' yourself!"
   -- Elysse, playing with a newborn baby.

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