22

I am considering creating a GUI-based tool that I want to be cross-platform. I've dismissed Java, as I personally do not like Swing. I'm currently considering C# and using Mono to make it cross-platform. However I'm wondering whether new-fangled cross-platform languages like Ruby can offer me a decent GUI development environment.

Argalatyr
  • 4,639
  • 3
  • 36
  • 62
David Arno
  • 42,717
  • 16
  • 86
  • 131
  • I actually use one cross-platform app that has a toolkit I could use: Netbeans. I think it is based on Swing, but you have Netbeans as an abstraction layer. I'd love to do something in Ruby, but all of the frameworks mentioned in the answers look pathetically immature. If only Microsoft had made .Net cross-platform... – Dan Rosenstark May 06 '09 at 10:35
  • Um, .NET is cross-platform. It's called Mono, yo. – Jonathan Sterling Dec 01 '09 at 00:38
  • See [With what tools can I make a complex and advanced GUI with Ruby?](https://softwarerecs.stackexchange.com/q/53553/36725). – sondra.kinsey Apr 10 '19 at 00:33

13 Answers13

38

The short answer: no (because you said cross-platform).

The long answer: cross-platform GUIs are an age-old problem. Qt, GTK, wxWindows, Java AWT, Java Swing, XUL -- they all suffer from the same problem: the resulting GUI doesn't look native on every platform. Worse still, every platform has a slightly different look and feel, so even if you were somehow able to get a toolkit that looked native on every platform, you'd have to somehow code your app to feel native on each platform.

It comes down to a decision: do you want to minimise development effort and have a GUI that doesn't look and feel quite right on each platform, or do you want to maximise the user experience? If you choose the second option, you'll need to develop a common backend and a custom UI for each platform.

ruby is not a bad choice for your common backend.

Stewart Johnson
  • 14,281
  • 7
  • 61
  • 70
  • 1
    Even though I don't /like/ you answer - as it isn't what I wanted to hear - this is the most useful (and honest! :) answer. – David Arno Sep 24 '08 at 15:48
  • 1
    Doesn't SWT for Java try to resolve the problem with having a native GUI in a cross platform environment? – Kibbee Oct 18 '08 at 18:05
  • 2
    I think the only GUI that people accept as "native" but isn't native is the web browser. That's why I like RIAs so much. – Nosredna Jul 11 '09 at 03:44
  • 3
    Qt applications do look and feel native when properly designed. – Jason Voegele Oct 08 '10 at 15:44
8

Ruby has Shoes, but that might be a little lightweight.

Community
  • 1
  • 1
William Keller
  • 5,256
  • 1
  • 25
  • 22
  • My experience with shoes is that it's not great.. – irl_irl Nov 18 '10 at 20:42
  • By the way, the link isn't working for me. Is the shoes project dead? – Genadinik Apr 28 '11 at 16:53
  • The Shoes project has been restarted, with a new approach: It has a pure Ruby API, which is mostly compatible with the old versions, and a pluggable toolkit which creates the actual visuals. (Currently the only toolkit is Java Swing) – Daniel Rikowski May 09 '14 at 08:23
8

You'll have Ruby/GTK, which allows you to use the GTK toolkit under linux. I think that should be working under Windows and Mac Os (as for Gimp, Gaim and so on).

A french magazine post a good beginner article about Ruby/GTK.

Edit : According to main page on the SourceForge project, Ruby-Gnome2 (aka Ruby/GTK) is cross-platform (Windows, Linux, Mac Os).

paulgreg
  • 18,493
  • 18
  • 46
  • 56
  • GTK... SciTE, ported via GTK it was moved from 900 kbytes for Win to 80 mbytes for Mac. Even if not count all the dependencies (python, perl, sqlite...), it just takes ~20sec to launch it. – Nakilon Sep 08 '13 at 03:13
7

With Ruby you can use Tk, which is a mature, cross platform UI toolkit. It is the defacto GUI toolkit for Python and Tcl, and is also available for use with Perl. The most recent versions of Tk make use of native widgets which addresses the primary concern that Tk looks dated.

A language-neutral website devoted to Tk is http://www.tkdocs.com/ which includes examples coded in both Ruby and Tcl.

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • A tip for anyone looking at TK, at least for me, plan ahead and what you want your UI to look like, and each pane. Then learn what those things are called in TK, and the rest should fall into place. I dove into it thinking I'd crank out the next best thing, but I learned I had a long ways to go. – FilBot3 Aug 30 '16 at 01:23
2

There's also FXRuby which has the benefit of a Pragmatic Programmer book, as well as wxRuby which is based on the wxWidgets C++ GUI framework.

2

Take a look at Ruby GUI 2008 Survey Results and the discussion here. You will love to know.

pierrotlefou
  • 39,805
  • 37
  • 135
  • 175
2

being a wxperl programmer, i know that wxruby is there as well. Wx is pretty fast and has true crossplatform look and feel.

sir_lichtkind
  • 318
  • 1
  • 10
1

Not sure about Ruby, but you mentioned Mono/C# -- I've used Mono and GTK# quite a bit lately and am very impressed. Seems to be pretty stable and cross-platform portability is nice.

DustinB
  • 11,037
  • 5
  • 46
  • 54
1

Ruby/GNOME2 works pretty well. You can use Glade to drag and drop window elemtns and load it the UI from your Ruby app.

Farrel
  • 2,383
  • 18
  • 14
0

Have you looked at SWT on Java? It uses native widgets and is much easier to get a nice interface with it than Swing.

Dan Harper
  • 1,130
  • 10
  • 22
0

I would suggest looking at visualruby. Its an IDE to create GUIs using ruby. It uses GTK as its graphics toolkit, and the apps look great to me on any platform. You can see screenshots on Win7, WinXP, Ubuntu, and Mac on the screenshots page:

http://visualruby.net/site/Screen%20Shots.html

You can easily try it on every platform by installing visualruby on various platforms, and running the example programs.

The checked answer was written before visualruby was released.

user1182000
  • 1,625
  • 14
  • 12
0

I strongly back Qt for cross platform GUI development. It's awesome and APIs are very intuitive. GUI look and feel almost native with Qt because it uses GUI controls provided by underlying OS.

Though the basic interface with C++ other language bindings are available. For Ruby RubyQt is available. Unfortunately it's very immature.

sth
  • 222,467
  • 53
  • 283
  • 367
prasadvk
  • 1,568
  • 2
  • 13
  • 13
0

If you ever venture over to the mac, check out RubyCocoa. It is obviously only for OSX, but I've seen a lot of folks scratch their head when looking to do GUI development on the mac and if you love ruby RubyCocoa is a lot of fun.

sammich
  • 335
  • 5
  • 13
  • 19