Re: signals



try "mouse-didnt-meve-event"

I'm sorry I couldn't resist; essentialy there 
is no windowing system event propagated 
when a mouse doesn't move.

save the mouse state and add a timeout
of `n' milisecs every `n' milies --> spray.

cancel timeout on button release.

you might want to experiment removing
the motion-notify hooks.... could make a smoother 
and more uniform airbrush result

cheers,
                -Tristan

Chris Garrett wrote:

Hi,

I asked this once in a roundabout way but did not get any replies, so I'll
try again :o)

I have a drawing area.  Currently when the mouse button is pressed, my
airbrush tool sprays onto the canvas.  It then sprays whenever the mouse is
moved and the mouse button is held down.  It does not spray if the mouse is
not moved (ala the scribble app in the GTK tutorial)

I want to change this behaviour so that the mouse does not have to be moved
for the next spray to take place (ie. I could hold the mouse still and keep
the mouse button pressed, and the airbrush would keep spraying).

How can I implement this?  There are signals emitted when a mouse button is
pressed initially, and when the mouse moves, but I cannot see any signals
for when the mouse button is held down.

Can anyone help?  Is there a particular event emitted by the drawing area
that I can guarantee will take place each iteration of gtk_main()?  Is there
another approach I can take?

Chris.

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE*
http://join.msn.com/?page=features/virus

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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