Running your own GUI with Ruby

I would like to develop a desktop application with Ruby. However, I would like to have my own graphical interface on each platform (as opposed to the cross-platform GUI toolkit, which looks constantly terrible on all platforms).

I expect that for each platform I will have to use different graphical interfaces (since this does not just look, but also the behavior and idioms that are different), but I wonder what my options are? Particularly interesting is there a clean way to separate the front and backend and properly bind the data?

Target platforms are Windows (Vista and 7, XP is a bonus), Mac OS X (Cocoa) and Linux (GTK? Qt? No idea).

+8
user-interface linux windows ruby macos
source share
3 answers

The Ruby language has excellent Qt library bindings , and your scripts will be cross-platform.

+4
source share

Two types of cross platform

It turns out there are two kinds of cross-platform tools for the user interface.

One view draws its own controls, and, as you said, it looks equally bad on all platforms. Even worse: he looks out of place at all but one.

But there is another view that simply provides a consistent interface with native widgets. The best example of this kind of toolkit is SWT 1 .. It seems like it's almost completely native to every platform, but it has only one API.

Therefore, you should not just exclude all cross-platform tools, just exclude those that fake your own interface.

Develop Wrapper Interface

There is a second way. If your programming interface with a user can be directed through a relatively narrow interface, you can simply go to that interface and then implement the bottom of it for each platform that you want to support. Yes, you need to rewrite one module, but all other modules remain the same, and you get your own widgets. You also get the smallest executable possible without much bloat.

Perhaps most importantly, you do not have a complex and opaque software layer between your code and your own windows system. You will probably save as much time debugging as you spend on creating an additional module for your first port.


1. I know that my Java examples will not help you if you are not using jRuby, but SWT vs Swing is a really clean example of disassembling UI tools (IMHO).

+3
source share

The WxWidgets interface claims to use its own interface for Windows, OS X, Linux, and UNIX through a single API.

The employees who used it in the past enjoyed it well enough, but I did not use it myself.

+2
source share

All Articles