[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

GUI programming for WinXP/Linux/OSX?

RHaus

9/26/2006 7:58:00 AM

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.


--
Posted via http://www.ruby-....

42 Answers

Thomas Adam

9/26/2006 8:05:00 AM

0

On Tue, 26 Sep 2006 16:58:07 +0900
Roman Hausner <roman.hausner@gmail.com> 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 Adam

RHaus

9/26/2006 8:11:00 AM

0

Thomas Adam wrote:
> On Tue, 26 Sep 2006 16:58:07 +0900
> Roman Hausner <roman.hausner@gmail.com> 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 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.

--
Posted via http://www.ruby-....

Mariano Kamp

9/26/2006 8:23:00 AM

0

Roman Hausner wrote:

>> Roman Hausner <roman.hausner@gmail.com> 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/h...

Cheers
Mariano


Thomas Adam

9/26/2006 8:24:00 AM

0

On Tue, 26 Sep 2006 17:11:28 +0900
Roman Hausner <roman.hausner@gmail.com> 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 Adam

Greg Chagnon

9/26/2006 8:25:00 AM

0

Roman Hausner wrote:
> 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

Perhaps wxRuby http://wxruby.rubyforge.org/wi... will help.

Paul Lutus

9/26/2006 9:02:00 AM

0

Roman Hausner 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.ara.../ruby/graphinity/...

http://www.ara.../ruby/gravity/...

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

I think this deserves a look.

--
Paul Lutus
http://www.ara...

Timothy Goddard

9/26/2006 9:42:00 AM

0

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.

Roman Hausner wrote:
> 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.
>
>
> --
> Posted via http://www.ruby-....

Alexandru E. Ungur

9/26/2006 10:17:00 AM

0

>>> sender: "Roman Hausner" 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/wind...

Hope it helps,
Alex

RHaus

9/26/2006 10:24:00 AM

0

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

--
Posted via http://www.ruby-....

riko

9/26/2006 10:31:00 AM

0

Thomas Adam <thomas.adam22@gmail.com> 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).


--
blog: http://www.akropolix.net/... | Uccidete i filosofi,
site: http://www.akropolix... | tenetevi riso e
forum: http://www.akropolix.... | bacchette per voi.