I’m planning a fairly simple application to build while learning GNOME &
GTK with Ruby. I could use some help in choosing the appropriate
widgets.
I want to draw several boxes, containing text and joined by lines –
something like a Data F. Diagram or Entity Relation diagram. The user
will be able to create new boxes, edit the text and move them around.
The lines will be redrawn to maintain the relationships. It isn’t unlike
Dia, but will be highly specialised and much simpler.
Which widgets should I use for the “canvas” and the “boxes”? Will I have
to do the D&D myself the hard way? And all my drawing, with everything
in DrawingAreas?
On So, 2006-11-19 at 09:08 +0000, Mike Wilson wrote:
D&D myself the hard way? And all my drawing, with everything in DrawingAreas?
Hi,
most programs use the Gnome::Canvas for tasks like this. But the
Gnome::Canvas in ruby-gnome is not documented at all.
An other possibility is to use Gtk::Layout. On this you can place other
widgets and you can also draw grafics on it. I did it this way from C
for a similar program and it worded well.
Which widgets should I use for the “canvas” and the “boxes”? Will I have to do the
I might also suggest taking a look at Cairo [www.cairographics.org] (and
rcairo). It gives you some drawing primitives, but not must else so you
would have to implement most of the interaction yourself. As an
example, I use it in Grism (www.grism.org) to draw the stock charts.