Re: Gtk2::SimpleList signal question

On Wed, Dec 07, 2005 at 09:19:34PM -0500, muppet wrote:

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

I'm using a Gtk2::SimpleList to assign sounds for events in an  
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";

Thanks, did the trick nicely.



Sean Dague                                       Mid-Hudson Valley
sean at dague dot net                            Linux Users Group                       

There is no silver bullet.  Plus, werewolves make better neighbors
than zombies, and they tend to keep the vampire population down.

Attachment: pgptcfoMTIb5q.pgp
Description: PGP signature

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