GUI programming for WinXP/Linux/OSX?

R

Roman Hausner

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.
 
T

Thomas Adam

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 Adam
 
R

Roman Hausner

Thomas said:
Tk, then.


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.


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


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

-- Thomas Adam

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.
 
T

Thomas Adam

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 Adam
 
T

Timothy Goddard

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.
 
R

Roman Hausner

mmmkay ... :)

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.
 
M

Mc Osten

Thomas Adam said:
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).
 
M

Mc Osten

Paul Lutus said:
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.
 
U

Une bévue

Mc Osten said:
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 ???
 
M

Mc Osten

Une bévue said:
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.
 
R

Reid Thompson

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.
see also http://wxwidgets.org/about/screensh.htm
 
L

Logan Capaldo

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)
 
M

M. Edward (Ed) Borasky

Roman said:
mmmkay ... :)

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.

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. :( 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?
 
M

M. Edward (Ed) Borasky

Paul said:
Roman Hausner 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.

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.
 
D

Dave Baldwin

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. :( 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.
 
C

Charles O Nutter

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).

For what it's worth, there are a few examples already out there of
using JRuby with SWT and Swing that look pretty nice. It's basically
just Ruby code in the end, and works pretty well.

I for one would really love to see some community effort to create a
standard GUI library API that can be backed by whatever library,
somewhat in the spirit of SWT. With such an API, we could have a Swing
or SWT-backed implementation in JRuby, and MRI could use GTK, QT,
win32, Cocoa, Fox, or whatever. GUI developers could build to the API,
not to the library, and it would work anywhere.

However I think Swing has shown that building a general GUI widget API
is a difficult thing to get right, and everyone's going to have their
own preferences.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,983
Messages
2,570,187
Members
46,747
Latest member
jojoBizaroo

Latest Threads

Top