[wxruby-users] sample desktop app

Alex Fenton alex at pressure.to
Wed Sep 24 02:57:21 EDT 2008


Hi Nathan

Nathan Macinnes wrote:
> I'm trying to develop a desktop application, and since I've done a fair
> bit of work with RoR before, I figured ruby is a good way to go about
> it. My application will be largely database driven.
> I'm looking for a sample desktop application which I can learn a few
> things from. Obviously the less restrictive the license the better, and
> it'd also be good if I can find one which is database driven. Google
> seems to provide very little.. or at least, the results are cluttered by
> RoR things. I was wondering if anyone in the group knows of any.
There's a list of some wxRuby applications on the wiki:
http://wxruby.rubyforge.org/wiki/wiki.pl?OnlineCodeExamples

Of those, Weft QDA is a database (SQLite) backed application, and has a 
public domain licence.
http://rubyforge.org/projects/weft-qda/

It uses its own ActiveRecord-like persistence layer, with an Observer 
pattern to update the relevant GUI elements as changes to the database 
are saved. I'd recommend you look at the code in Subversion as its a 
better model for designing database apps.

A disadvantage for study purposes is that its a relatively complex app - 
 > 15k lines of ruby code, with a schema running to several hundred 
lines using triggers and views:
http://weft-qda.rubyforge.org/svn/trunk/weft-qda/share/schema.sql

A simpler example to look at might be Ruby SQLite GUI, which is a 
desktop browser for SQLite databases:
http://rsqlitegui.rubyforge.org/

It uses Ruby-GTK2, rather than wxRuby. GTK2 is another good GUI library, 
long established and with a wide range of widgets. However IMHO it works 
considerably less well on Windows and OS X than it does on Linux, 
whereas wxRuby is equally good on all three.

hth
alex


More information about the wxruby-users mailing list