Hello, I use Ruby for web applications and I want to know what's the best practice for a desktop application. I know there is some libraries to build desktop application like QTRuby but I don't know if it's as powerful as Java's libraries or C#. So, what is the best practice to create a desktop application in the Ruby Way? Should I really use Ruby? Is there a Rails like for desktop applications? Is there some books on the subject? Thanks!
on 2013-02-11 15:07
on 2013-02-11 16:04
I've built a few simple desktop apps using Ruby, Tk, and Ocra. There are plenty of possibilities, but I assume that you want to pick the best tools for the job by looking at your objectives. Without a bit of detail about the kind of application you want to build and its capabilities and portability, not to mention all the other priorities you might have (load speed, code-writing speed, memory size, API usage etc); it'll be difficult to know what the best approach is.
on 2013-02-11 16:29
For exemple, I want to create an application to manage a small business. I want to store contacts, products and bills. I need a simple interface. Nothing very complicated but I need a clean and pretty interface. I can build it with Swing, in Java. In this case which tool can I use? Is it better to build a local web application?
on 2013-02-11 16:48
Subject: Re: The "ruby way" to do desktop applications? Date: mar 12 feb 13 12:29:45 +0900 Quoting guirec c. (email@example.com): > For exemple, I want to create an application to manage a small business. > I want to store contacts, products and bills. I need a simple interface. > Nothing very complicated but I need a clean and pretty interface. I can > build it with Swing, in Java. > > In this case which tool can I use? Is it better to build a local web > application? This is a bit of a weak point in Ruby. The GUI that has been included in Ruby from the beginning is Tcl/TK. One tutorial is this: http://rubylearning.com/satishtalim/ruby_tk_tutorial.html Sadly, TK is a bit lame. It may be perfect for your application, but it is far from flashy. In the Linux world, two GUI libraries are mainly used: Gtk and QT. About QT I can't tell you much - it is in C++ and I do not like its esthetics, so I always kept clear. I know there are bindings for Ruby. Gtk has bindings in Ruby. They are maintained almost single-handedly by Kohei Sutou. He is a hero... Read more here: http://ruby-gnome2.sourceforge.jp/ I have used them for several projects. The learning curve is a bit steep, but the results are quite professional-looking. The only problem is that not too many people seem to adopt Gtk/Gnome anymore. If you look for a marketable skill, the investment in time may not prove too profitable. If you want to use Jruby, I believe you can use Swing from Ruby code. About that, too, I know nothing. If you use Macs, I believe you can use Cocoa from Macruby. See www.macruby.org. There are other choices, from what I remember, but none seem to be very popular. Carlo
on 2013-02-11 17:02
One other option is shoes, which has been getting some updates recently. But still I have to agree that one of my major losses in moving all my coding to Ruby has been lack of good GUI tools. If I didn't have to worry about others, I would use MacRuby and just use the APIs available to me there, but as mentioned, this doesn't work well when scripts must run on both Windows, and Macs. Wayne
on 2013-02-11 17:14
I want to build an application at least compatible with Windows. I'm not sure about JRuby. Is it better to use JRuby or pure Java? I think to use an alternative is a source of bugs. About Shoes, it seems to be very simple. Is it possible to create trees, panels and more advanced components? To create a local web app can be more complexe because it must have a web server. For the moment, I think I will develop a desktop application with Java.
on 2013-02-11 18:48
on 2013-02-11 19:44
guirec c. wrote in post #1096304: > ... I want to create an application to manage a small business. > ... I need a simple interface. > Nothing very complicated but I need a clean and pretty interface. I can > build it with Swing, in Java. > > In this case which tool can I use? Is it better to build a local web > application? Hi Guirec, Shoes, Shoes, and Shoes... it's dead simple, multi-platform, and uses native widgets to look good. Shoes4 https://github.com/shoes/shoes4 is on the way, and uses Java and Swing (among other things) - so anything you can do there you should be able to do with Shoes... only more in the 'ruby-way' ;) until Shoes4 is stable and released, you can check out the various flavors of Shoes to see which is best for you. red shoes http://shoesrb.com/ is the standard bearer - carried on from _why's amazing work. green shoes https://github.com/ashbb/green_shoes is another popular variety - you can install it with a gem, and then make apps that are packaged in gems (which require green_shoes.) if you're familiar with java, purple https://github.com/ashbb/purple_shoes or brown https://github.com/shoes/brown_shoes shoes might be your fit... Shoes4 is largely based around the efforts of brown and purple shoes, and if you have knowledge of Java with Swing and/or Swt you might be able to help out making Shoes even better! - j
on 2013-02-11 20:09
on 2013-02-11 22:24
On Tuesday 12 February 2013 Carlo E. Prelz wrote > > application? > QT. About QT I can't tell you much - it is in C++ and I do not like > its esthetics, so I always kept clear. I know there are bindings for > Ruby. I like Qt very much instead. The bindings are quite complete and there's a gem for it called qtbindings. I'm not entirely sure about this, but I think you have to install the Qt library itself (http://qt-project.org/downloads, mind to download the 4.8 version not the 5.0 one), before installing the gem. The only drawbacks of these bindings is that they keep a bit too much of the C++ approach and that there isn't specific documentation for the ruby version. They closely follow the C++ API, though, so you can use that (http://qt-project.org/doc/qt-4.8/classes.html) as reference. Stefano
on 2013-02-11 22:51
Stefano Crocco wrote in post #1096380: > On Tuesday 12 February 2013 Carlo E. Prelz wrote > I like Qt very much instead. The bindings are quite complete and there's > a gem for it called qtbindings. I can also add a recommendation for QT. I did extensive work with it under Python and had very few surprises; I've done a few small apps with Ruby and QT and found it as easy to work with as under Python. It's not perfect but having played with some of the other options, found QT somewhat more mature and capable.
on 2013-02-12 13:16
what about qtruby?
on 2013-02-13 01:04
I've been using FXRuby too much, I've found 4 bugs in the way, only one was resolved, the others remains in the bug tracker with no response, this is because the project is unmaintained, Lars Kanis is supposed to be in charge but he rarely response. The framework is very nice, I've tested it only in Windows 7 64 bits and XP 32 bits. Supposedly works on any OS, at least Linux and Windows... Here's the webpage: https://rubygems.org/gems/fxruby FXRuby is a wrapper of the Fox C++ library. If you chose to pick this one I can help you from the FXRuby Forum right here, I'm the only writting there, feels lonely ^^. Cheers.
on 2013-02-13 16:33
+1 for Qt I have been using FXRuby and GTk. I switched to Qt because it's the only framework which gives *exactly* the same look and feel on Windows and OSX. Once you get used to the "signal/slot" idiosyncrasy, it is quite simple to work with. The ruby binding 'qtbindings' is transparent and the Qt documentation is excellent. On the qtbindings' site, you can find the ruby translation of the Qt tutorials, which helps building the translation experience. On Windows, Qt is packed in the binary gem. Nothing to do except a gem install. Shoes is wonderful for simple things, but quite limited. _md
on 2013-02-13 18:38
I think I will use QtRuby. It seems to be very simple. Somebody know if it's as powerful as pure QT?