# Selecting appropriate widgets -- advice please

**URL:** <https://www.ruby-forum.com/t/selecting-appropriate-widgets-advice-please/76475>\
**Category:** Ruby-Gnome 2\
**Created:** [November 19, 2006, 10:10am UTC](https://www.ruby-forum.com/t/selecting-appropriate-widgets-advice-please/76475 "2006-11-19T10:10:19Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mike\_Wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@Mike\_Wilson](https://www.ruby-forum.com/u/Mike_Wilson)\
**Post date:** [November 19, 2006, 10:10am UTC](https://www.ruby-forum.com/t/selecting-appropriate-widgets-advice-please/76475/1 "2006-11-19T10:10:19Z")

</div>

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?

* * *

Mike Wilson, Wrexham, North Wales, UK  
[www.whisperingwind.co.uk](http://www.whisperingwind.co.uk)

Send instant messages to your online friends

> **[Yahoo | Mail, Weather, Search, Politics, News, Finance, Sports & Videos](https://www.yahoo.com/)**
>
> Latest news coverage, email, free stock quotes, live scores and video are just the beginning. Discover more every day at Yahoo!

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Mike\_Wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@Mike\_Wilson](https://www.ruby-forum.com/u/Mike_Wilson)\
**Post date:** [November 19, 2006, 11:10am UTC](https://www.ruby-forum.com/t/selecting-appropriate-widgets-advice-please/76475/2 "2006-11-19T11:10:23Z")

</div>

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.

Cheers  
detlef

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)

---

<div class="post-metadata">

**Author:** ![Mike\_Wilson](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/c5a1d2/32.png) [@Mike\_Wilson](https://www.ruby-forum.com/u/Mike_Wilson)\
**Post date:** [November 19, 2006, 11:18am UTC](https://www.ruby-forum.com/t/selecting-appropriate-widgets-advice-please/76475/3 "2006-11-19T11:18:24Z")

</div>

Detlef R. wrote:

> > 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](http://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](http://www.grism.org)) to draw the stock charts.

Cheers,  
Nick

* * *

Take Surveys. Earn Cash. Influence the Future of IT  
Join [SourceForge.net](http://SourceForge.net)’s Techsay panel and you’ll get the chance to share  
your  
opinions on IT & business topics through brief surveys - and earn cash  
[http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV](http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV)
