Thursday, 30 October 2014

Basic Cairo, Mouse Click, Drag and Position

The script shows some techniques in defining a drawing area using Cairo. Mouse click and mouse movement are detected in the widget.


  1. Define a drawing area using Cairo.
  2. Add 3 mouse event handlers: mouse-press, mouse-release and mouse-movement.
  3. Because of the above event handlers, the app can recognize mouse clicking, dragging and moving.
  4. Get the dimensions of a drawing area.
  5. Redraw graphics upon resizing the window.

Source Code


No comments:

Post a Comment