Re: Event Handling



I have a question about events. I have some sample code that I took from
one of the examples that hooks up an event handler to a
Gnome2::Canvas::Rect as follows:

$rect->signal_connect (event=>&rectevent);

and then later there's the handler code:

sub rectevent
{
    warn("event: " . $event->type . "/n");
}

Nice, but this handler will receive all events. Is there a way to
indicate to Gnome that my program is only interested in, say,
"button-press"  events and to call my handler
only for "button-press" events. Or do I have to handle all possible
events in my handler?

$rect->signal_connect('button-press' => \&rectevent);

regards, bostjan




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