[Glade-users] any example about the ruler widget?

Damon Chaplin damon@karuna.uklinux.net
Sun, 16 Jan 2005 16:02:42 +0000


On Sun, 2005-01-16 at 15:05, zeng qiang wrote:
> Dear all,
> 
> I hope to implement the ruler (hruler and vruler) of the glade-2 in my
> GUI.
> 
> My plan is to use 2x2 table first and put into ruler widgets and one
> canvas.
> 
> From the GIMP(an image viewer), i saw very impressvie usage of the
> rulers: the arrows on the ruler could move together with the mouse
> movement. it 's indeed very useful.
> 
> So I wonder if there is any glade example that can explain the rulers
> functions and how we can use these rulers.  

Look at examples/rulers in GTK+. You need to connect to the
"motion-notify-event" of the canvas and pass these events on the the
ruler.

The GTK+ tutorial also covers this:
  http://www.gtk.org/tutorial/sec-rulers.html

Damon