Re: Tracking motion on drawing area

After playing around a bit and looking at the documentation I got it
to work.

The trick is to use the "events" flag when creating the Gtk::DrawingArea
to make it respond to motion events. I'm including a complete example
below. Also, don't forget that you will have to do the painting in the
exposure callback. I wrote a library called Gtk::Window::Draw that 
provides a nice syntax for doing drawing primitives that you might want
to use. 

Another much more high level use is to use the Gtk::Canvas widget. Why
don't you use that?


On Wed, Apr 03, 2002 at 08:02:22AM -0800, Nguyen Tran Quoc Vinh wrote:
I don't know how to get the coordinates of the mouse point on the
DrawingArea. I have galde, glade-perl, gtk-perl on the Slackware 7.0.
Please tell what can i read in this case or how to get the tutorial for
  Thank you very much.
            Nguyen Tran Quoc Vinh


Attachment: motion-example
Description: Text document

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