GUI programming for WinXP/Linux/OSX?

Discussion in 'Ruby' started by Roman Hausner, Sep 26, 2006.

  1. 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-forum.com/.
    Roman Hausner, Sep 26, 2006
    #1
    1. Advertising

  2. Roman Hausner

    Thomas Adam Guest

    On Tue, 26 Sep 2006 16:58:07 +0900
    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


    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
    Thomas Adam, Sep 26, 2006
    #2
    1. Advertising

  3. Thomas Adam wrote:
    > On Tue, 26 Sep 2006 16:58:07 +0900
    > 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

    >
    > 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-forum.com/.
    Roman Hausner, Sep 26, 2006
    #3
  4. Roman Hausner

    Mariano Kamp Guest

    Roman Hausner wrote:

    >> Roman Hausner <> 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
    Mariano Kamp, Sep 26, 2006
    #4
  5. Roman Hausner

    Thomas Adam Guest

    On Tue, 26 Sep 2006 17:11:28 +0900
    Roman Hausner <> 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
    Thomas Adam, Sep 26, 2006
    #5
  6. Roman Hausner

    Newbie Guest

    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/wiki/wiki.pl will help.
    Newbie, Sep 26, 2006
    #6
  7. 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-forum.com/.
    Timothy Goddard, Sep 26, 2006
    #7
  8. >>> 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/windowsxp.html

    Hope it helps,
    Alex
    Alexandru E. Ungur, Sep 26, 2006
    #8
  9. 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.

    --
    Posted via http://www.ruby-forum.com/.
    Roman Hausner, Sep 26, 2006
    #9
  10. Roman Hausner

    Mc Osten Guest

    Thomas Adam <> 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/rik0/blogs | Uccidete i filosofi,
    site: http://www.akropolix.net/rik0/ | tenetevi riso e
    forum: http://www.akropolix.net/forum/ | bacchette per voi.
    Mc Osten, Sep 26, 2006
    #10
  11. Roman Hausner

    Mc Osten Guest

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

    --
    blog: http://www.akropolix.net/rik0/blogs | Uccidete i filosofi,
    site: http://www.akropolix.net/rik0/ | tenetevi riso e
    forum: http://www.akropolix.net/forum/ | bacchette per voi.
    Mc Osten, Sep 26, 2006
    #11
  12. Roman Hausner

    Une bévue Guest

    Une bévue, Sep 26, 2006
    #12
  13. Roman Hausner

    Une bévue Guest

    Mc Osten <> 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
    Une bévue, Sep 26, 2006
    #13
  14. Roman Hausner

    Mc Osten Guest

    Mc Osten, Sep 26, 2006
    #14
  15. On Tue, 2006-09-26 at 16:58 +0900, 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.
    >
    >

    see also http://wxwidgets.org/about/screensh.htm
    Reid Thompson, Sep 26, 2006
    #15
  16. On Tue, Sep 26, 2006 at 08:00:12PM +0900, Une b?vue wrote:
    > Mc Osten <> 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)
    > what about FOX on Mac OS X ???
    > --
    > une b?vue
    Logan Capaldo, Sep 26, 2006
    #16
  17. Roman Hausner wrote:
    > 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. Edward (Ed) Borasky, Sep 26, 2006
    #17
  18. Paul Lutus wrote:
    > 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.


    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.
    M. Edward (Ed) Borasky, Sep 26, 2006
    #18
  19. Roman Hausner

    Dave Baldwin Guest

    On 26 Sep 2006, at 15:02, M. Edward (Ed) Borasky wrote:
    <snip>
    >
    > 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.


    > Hmmm ... has anyone built a "GUI" using ruby-rsvg?
    >
    >
    Dave Baldwin, Sep 26, 2006
    #19
  20. On 9/26/06, Roman Hausner <> wrote:
    > 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.

    --
    Contribute to RubySpec! @ www.headius.com/rubyspec
    Charles Oliver Nutter @ headius.blogspot.com
    Ruby User @ ruby.mn
    Charles O Nutter, Sep 26, 2006
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. R.Marquez
    Replies:
    10
    Views:
    550
    Mark Roach
    Nov 21, 2003
  2. Replies:
    2
    Views:
    390
  3. e deleflie

    best GUI toolkit for windows/OSX

    e deleflie, Dec 20, 2007, in forum: Ruby
    Replies:
    7
    Views:
    84
    Matthew Harris
    Dec 21, 2007
  4. Sophie

    IRB GUI on OSX?

    Sophie, Dec 6, 2009, in forum: Ruby
    Replies:
    13
    Views:
    213
    Marnen Laibow-Koser
    Dec 8, 2009
  5. Jai
    Replies:
    99
    Views:
    564
    Joshua Landau
    Dec 26, 2013
Loading...

Share This Page