Re: Using the motion-notify-event
- From: Torsten Schoenfeld <kaffeetisch gmx de>
- To: gtk-perl-list gnome org
- Subject: Re: Using the motion-notify-event
- Date: Thu, 03 Mar 2005 14:22:04 +0100
On Thu, 2005-03-03 at 14:56 +0200, Ari Jolma wrote:
I have a window, where I have a ScrolledWindow, where I have an
EventBox, where I have an image. I get the motion-notify-event only when
I move the mouse with button pressed. How do I get the event without
having to press the button?
You need to add
$event_box->set_events([qw/pointer-motion-mask/]);
to enable firing the event for every pixel your mouse moves. If that's
too much, look into using pointer-motion-hint-mask[1].
I need the press-button-move event also for panning the image, but I
expected it to be the drag-begin drag-end events, which I did not yet
get fired in any case.
You need to explicitly enable d'n'd by using the various
Gtk2::Widget::drag_* methods. If you use a new-ish gtk+,
Gtk2::Widget::drag_source_add_image_targets and
Gtk2::Widget::drag_dest_add_image_targets will probably be helpful.
--
Bye,
-Torsten
[1]
http://developer.gnome.org/doc/API/2.0/gdk/gdk-Events.html#GdkEventMask
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]