Photo of Dr. S. Salewski

Homepage of Stefan Salewski

Drawing with Ruby and Cairo into a GTK Drawing Area

Here is a little Ruby demo program which draws some shapes into a GTK Drawing-Area (Window) using the Cairo library. You can zoom in and out with the mouse wheel, move the mouse pointer while the left mouse button is held down to select a zooming rectangle, or move the mouse pointer while the middle mouse button is held down for panning.

PedEd Demo Picture

Currently tested only for Linux (Gentoo AMD64). Of course you need GTK, Ruby, Cairo and the Ruby bindings (ruby-gtk2 and rcairo).

Here is the program file, now in an improved version 0.03:

And finally a picture of an intended application, in an very early state:

Demo Picture