Re: problems with motion notify event





you can't use a Drawing Area to catch such events! Use a EventBox to
catch the Events and add the Drawing Area to the Eventbox...

Yeah you can.  You just have to add the event masks to the drawing area.

Ie:

drawing_area->add_events( Gdk::POINTER_MOTION_HINT_MASK | Gdk::BUTTON_PRESS_MASK ) ;

You have to add the button press mask and the motion hint mask to make it work.  Not quite sure why, but there's probably a good reason somewhere.

Anyway, I've worked up a small example to kind of do what you want.  You'll have to work out updating the rulers when the window gets resized, or if you change the size of your drawing area.

Paul




Attachment: example.tar.gz
Description: GNU Zip compressed data



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