Re: Various Gtk2::DrawingArea questions
- From: Mario Kemper <mario kemper googlemail com>
- To: Aaron Lewis <alewis1970 yahoo com>
- Cc: "gtk-perl-list gnome org" <gtk-perl-list gnome org>
- Subject: Re: Various Gtk2::DrawingArea questions
- Date: Tue, 24 Jul 2012 12:32:24 +0200
2. The 'button-press-event' signal doesn't help me with detecting
double-clicks. Is there a different signal for this?
You can check the event-type in your callback to see if it is a double-click:
# Detect mouse clicks over the drawing area
$drawEventBox->signal_connect ('button-press-event' => sub {
my $widget = shift; # GtkWidget *widget
my $event = shift; # GdkEventExpose *event
my ($xPos, $yPos, $button) = ($event->x, $event->y, $event->button);
if($event->type eq '2button-press') {
print "double-click\n";
}
print("Signal button-press-event detected!\n");
print("x/y: $xPos/$yPos, button: $button\n");
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]