GUI programming for WinXP/Linux/OSX?

I am planning a project that has the following main requirements:

  • it must run on WinXP and Linux, idally also on OSX
  • it must have a GUI preferably with the GUI’s native widget set
  • it must allow scripting access to system resources with a modern and
    comfortable scripting language

The last point is what made me consider Ruby: I’d love to have Ruby
as the embedded scripting language here.

However, I cannot see how to solve the GUI issue, but maybe I have
missed
some things. Can anyone tell me if there is a common (portable) way to
easily implement a GUI, no matter what the underlying framework and
system
is? I am thinking some kind of GUI abstraction layer for using the same
API to control the GUI, no matter what the underlying system and
graphical framework is.

Is this possible with Ruby? Any experiences to share?

As I see it my only alternative is Java, especially as version 6 will
seemingly come with nature widget support and support for scripting.

If at all possible, I would prefer to do it all in Ruby though.

On Tue, 26 Sep 2006 16:58:07 +0900
Roman H. [email protected] wrote:

I am planning a project that has the following main requirements:

  • it must run on WinXP and Linux, idally also on OSX

Tk, then.

  • it must have a GUI preferably with the GUI’s native widget set

Native widget set? No such thing – it’s entirely dependant on the
widget set you wish to use, and that certainly bears no relation to the
GUI, as it’s the widget set that ultimately defines it.

  • it must allow scripting access to system resources with a modern and
    comfortable scripting language

Can you expand on that? What you’re describing here is separate from
the GUI, or should be.

The last point is what made me consider Ruby: I’d love to have Ruby
as the embedded scripting language here.

However, I cannot see how to solve the GUI issue, but maybe I have
missed
some things. Can anyone tell me if there is a common (portable) way to
easily implement a GUI, no matter what the underlying framework and
system

Again, Tk ships with Ruby, and works on Windows, so…

– Thomas A.

Thomas A. wrote:

On Tue, 26 Sep 2006 16:58:07 +0900
Roman H. [email protected] wrote:

I am planning a project that has the following main requirements:

  • it must run on WinXP and Linux, idally also on OSX

Tk, then.

  • it must have a GUI preferably with the GUI’s native widget set

Native widget set? No such thing – it’s entirely dependant on the
widget set you wish to use, and that certainly bears no relation to the
GUI, as it’s the widget set that ultimately defines it.

  • it must allow scripting access to system resources with a modern and
    comfortable scripting language

Can you expand on that? What you’re describing here is separate from
the GUI, or should be.

The last point is what made me consider Ruby: I’d love to have Ruby
as the embedded scripting language here.

However, I cannot see how to solve the GUI issue, but maybe I have
missed
some things. Can anyone tell me if there is a common (portable) way to
easily implement a GUI, no matter what the underlying framework and
system

Again, Tk ships with Ruby, and works on Windows, so…

– Thomas A.

Thank you for the quick response. I was aware of Tk, but - honestly - I
think Tk is ugly, anachronistic and even a lot worse than current Java
Swing.
Tk looks alien on all systems and it looks a lot more alien that
Java Swing.

This is going to be an educational program and I’d like to make the GUI
as similar to what people are used to on their native OS as possible.
This is especially a concern for things like the file picker, buttons
etc.

Unfortunately, I am pretty new to portable GUI programming at all – I
was
hoping that there was some abstraction layer that would simply adapt the
programmer’s interface to whatever the native underlying OS requires.

On Tue, 26 Sep 2006 17:11:28 +0900
Roman H. [email protected] wrote:

Thank you for the quick response. I was aware of Tk, but - honestly -
I think Tk is ugly, anachronistic and even a lot worse than current
Java Swing.
Tk looks alien on all systems and it looks a lot more alien that
Java Swing.

It’s all subjective, alas. I can semi-understand your concern
regarding Tk, although I actually quite like it. I suppose I could
suggest GTK to you as well as QT, since I know both those widget sets
will run on Windows (with the proviso that they’re installed of course
– certainly that doesn’t ship natively with Windows), although I have
no idea what that’s like for the Mac, or even if ports are available
for it. Again, there is also the wxWindows widget set (WxWindows is
the old name for it – I forget what it has been renamed to).

This is going to be an educational program and I’d like to make the
GUI as similar to what people are used to on their native OS as
possible. This is especially a concern for things like the file
picker, buttons etc.

Then your only concern really is going to be Windows and Mac, since
Linux doesn’t have the concept of a default look and feel to any of
its GUIs, since different programs are written in different widget
sets.

Unfortunately, I am pretty new to portable GUI programming at all –
I was
hoping that there was some abstraction layer that would simply adapt
the programmer’s interface to whatever the native underlying OS
requires.

Nope. It’s a case of try one and see.

– Thomas A.

Roman H. wrote:

Roman H. [email protected] wrote:
[… gui, native, winxp, linux, osx … ]

Did you have a look at SWT? You would need JRuby to run it, but SWT
gives you native widgets on OSX (Carbon), Windows and Linux (GTK and
Motif).

To start out you may want to have a look here:
http://www.jvoorhis.org/articles/2006/09/10/hello-jruby

Cheers
Mariano

I love GTK’s layout system. Try using Glade to design an interface and
you’ll see what I mean. The only bad thing I’ve noticed in Ruby/GTK is
that the tree / list view is highly confusing.

sender: “Roman H.” date: “Tue, Sep 26, 2006 at 05:11:28PM +0900” <<<EOQ
Thank you for the quick response. I was aware of Tk, but - honestly - I
think Tk is ugly, anachronistic and even a lot worse than current Java
Swing.
[…]
I have not used this, and have no ideea how well Tile plays with
Ruby/Tk,
but it certainly is not looking ugly at all:
http://tktable.sourceforge.net/tile/screenshots/windowsxp.html

Hope it helps,
Alex

Roman H. wrote:

/ …

If at all possible, I would prefer to do it all in Ruby though.

Recently I have been writing some apps using Ruby and the Qt library.
The Qt
library is available under the GPL for Linux, Windows and OS X. I much
prefer the Qt library over Tk – IMHO it is better-looking and has more
useful components.

I develop under Linux, where there is a Qt GUI designer application
called
“Qt Designer” (the executable is named “designer”), which is pretty
good.

Here are two examples of my recent Ruby/Qt apps:

http://www.arachnoid.com/ruby/graphinity/index.html

http://www.arachnoid.com/ruby/gravity/index.html

Here’s a link to the Qt download site (scroll down to the section marked
“Qt
Open Source Downloads”):

http://www.trolltech.com/products/qt/downloads

I think this deserves a look.

Thomas A. [email protected] wrote:

I suppose I could
suggest GTK to you as well as QT, since I know both those widget sets
will run on Windows (with the proviso that they’re installed of course
– certainly that doesn’t ship natively with Windows), although I have
no idea what that’s like for the Mac, or even if ports are available
for it. Again, there is also the wxWindows widget set (WxWindows is
the old name for it – I forget what it has been renamed to).

QT is quite nice on the MacOS X (although far from looking native).
GTK does not exist on MacOS X (unless you run it in X11, but that is
like saying the GUI is NOT native). A port is being made, but I don’t
know how well it works.
wx is a lot worse than QT (on the MacOS X).

mmmkay … :slight_smile:

Thank you all for your valuable answers! As far as I can see
everyone has their own preference here.

This is probably partly due to prior experience with a
framework or the fact that a certain framework was chosen.

As of now, the following choices seem to be available:

= Tk: comes with Ruby, so should be easy to deploy.
= Qt
= GTK
= JRuby plus some Java GUI, preferably SWT
= It seems there is also FXRuby (http://www.fxruby.org/)
(non-native widgetset).

Does anyone know of some objective comparisons of these
approaches? Especially with regard to learning curve,
stability, integration with Ruby, interactive GUI design,
and ease of deployment?
As I said, I am new to GUI programming, so this all looks
a bit intimidating at the moment.

I probably will dig a bit into JRuby – I guess this will
make availbale a lot of Java library functions to a Ruby-like
language – and I guess, also take away all non-Ruby-only
packages and extensions from the Ruby side.
But having the existing set of Java libraries available
together with Ruby as a programming and scripting language
does sound very inviting indeed.

Mc Osten [email protected] wrote:

QT is quite nice on the MacOS X (although far from looking native).
GTK does not exist on MacOS X (unless you run it in X11, but that is
like saying the GUI is NOT native). A port is being made, but I don’t
know how well it works.

what about FOX on Mac OS X ???

Une bévue [email protected] wrote:

what about FOX on Mac OS X ???

I never tried it. However, if you give me a short list of FOX
applications, I’ll be glad to try them and report my opinions.

Paul L. [email protected] wrote:

Recently I have been writing some apps using Ruby and the Qt library. The Qt
library is available under the GPL for Linux, Windows and OS X. I much
prefer the Qt library over Tk – IMHO it is better-looking and has more
useful components.

+1

Among cross platform environments QT is the one that better looks on
MacOS X. If MacOS X is the concern.

On Tue, 2006-09-26 at 16:58 +0900, Roman H. wrote:

However, I cannot see how to solve the GUI issue, but maybe I have
As I see it my only alternative is Java, especially as version 6 will
seemingly come with nature widget support and support for scripting.

If at all possible, I would prefer to do it all in Ruby though.

see also http://wxwidgets.org/about/screensh.htm

Alexandru E. Ungur [email protected] wrote:

I have not used this, and have no ideea how well Tile plays with Ruby/Tk,
but it certainly is not looking ugly at all:
http://tktable.sourceforge.net/tile/screenshots/windowsxp.html

not too bad :wink:

Roman H. wrote:

= Tk: comes with Ruby, so should be easy to deploy.
As I said, I am new to GUI programming, so this all looks
a bit intimidating at the moment.

I probably will dig a bit into JRuby – I guess this will
make availbale a lot of Java library functions to a Ruby-like
language – and I guess, also take away all non-Ruby-only
packages and extensions from the Ruby side.
But having the existing set of Java libraries available
together with Ruby as a programming and scripting language
does sound very inviting indeed.

I’m at a similar decision point. I don’t have a Mac and don’t plan to
test on one, but I don’t want to rule out Macs from using my
application. My personal opinions:

  1. Tk is ugly, but it’s a “de facto standard” and does come built-in.
  2. QT is the best looking, but the Ruby-QT4 bindings are still a tad
    unstable on my development platform (Gentoo Linux testing) and QT3 isn’t
    open source on Windows.
  3. GTK is ugly – IMHO uglier than Tk. Maybe I just haven’t figured out
    how to make the fonts do what I want yet, but I can’t stand the look of
    most GTK apps.
  4. JRuby – I don’t know much about it.
  5. FXRuby – right now this is the front-runner. If I can get drag and
    drop to work from the examples that come with it, I’ll probably settle
    on this one.

The app I’m building will have a Dia/Visio/XFig/Inkscape-like “drag and
drop shapes onto a canvas” GUI, but not a full diagramming package. I’ve
actually considered using one of the open-source diagramming packages as
a front end but I haven’t found one that’s Ruby-scriptable – Python and
Guile/Scheme appear to be the scripting languages of choice for such
codes. :frowning: If I go this way I’ll have to have the diagramming package
export XML or SVG and have the Ruby program execute it.

Hmmm … has anyone built a “GUI” using ruby-rsvg?

On Tue, Sep 26, 2006 at 08:00:12PM +0900, Une b?vue wrote:

Mc Osten [email protected] wrote:

QT is quite nice on the MacOS X (although far from looking native).
GTK does not exist on MacOS X (unless you run it in X11, but that is
like saying the GUI is NOT native). A port is being made, but I don’t
know how well it works.

I may be wrong, but I’m pretty sure FOX uses X11 under OS X. (But I
don’t like how FOX looks on Windows or X as it is, so I may be biased)

On 26 Sep 2006, at 15:02, M. Edward (Ed) Borasky wrote:

The app I’m building will have a Dia/Visio/XFig/Inkscape-like “drag
and drop shapes onto a canvas” GUI, but not a full diagramming
package. I’ve actually considered using one of the open-source
diagramming packages as a front end but I haven’t found one that’s
Ruby-scriptable – Python and Guile/Scheme appear to be the
scripting languages of choice for such codes. :frowning: If I go this way
I’ll have to have the diagramming package export XML or SVG and
have the Ruby program execute it.

Google sketchup is a free drawing app that uses Ruby for plugins and
general extensions. It is available for OSX and Windows, but not
Linux, so may not be of interest to you.

Dave.

Paul L. wrote:

I develop under Linux, where there is a Qt GUI designer application called
“Qt Designer” (the executable is named “designer”), which is pretty good.

IIRC QTDesigner runs on all platforms where QT itself runs, so you don’t
need a Linux development platform.

I think you need QT4 if you want open source on Windows, though.

Mc Osten [email protected] wrote:

I never tried it. However, if you give me a short list of FOX
applications, I’ll be glad to try them and report my opinions.

i never get more deeper than “hello workd” :wink:

the same for QtRuby and Java-Swing-Ruby (JRuby is toooo slow).

for ui design i’m mostly doing Cocoa (and RubyCocoz) and Java-SwingX
years ago…

for the time being i don’t have a need for X-platform however within
weeks or month i’ll need that.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs