[Gtk-sharp-list] Drawing Area and Mouse Button Signals

"Manuel V. Santos López" mvsl@telefonica.net
Tue, 24 Aug 2004 23:44:32 +0200


Hi,

you should set the event mask before realizing the drawingarea.

The code should read:

> 			drawingarea = new Gtk.DrawingArea();
> 			drawingarea.SetSizeRequest(700, 400);
-----> 			// vbox2.PackEnd(drawingarea);
> 
> 			drawingarea.ExposeEvent += new ExposeEventHandler(drawingarea_expose_event_cb);
> 			drawingarea.ConfigureEvent += new ConfigureEventHandler(drawingarea_configure_event_cb);
> 			drawingarea.MotionNotifyEvent += new MotionNotifyEventHandler(drawingarea_motion_notify_event_cb);
> 			drawingarea.ButtonPressEvent += new ButtonPressEventHandler(drawingarea_button_press_event_cb);
> 			drawingarea.Events = EventMask.ExposureMask | EventMask.LeaveNotifyMask |
> 						EventMask.ButtonPressMask | EventMask.PointerMotionMask |
> 						EventMask.PointerMotionHintMask;
> 
> 			drawingarea.CanFocus = true;
> 			drawingarea.GrabFocus();
> 
> 			canvas = new DamageCanvas(drawingarea);
----->			vbox2.PackEnd(drawingarea);

> 			main_window.Resize(800, 500);
> 

Hope it helps you.

Greetings,
Manuel V. Santos López.