I want to write a small desktop application on Ruby. I want the
application to be platform independent. I am using Fedora Linux for
building app. but I want the application to run on Windows as well.
I want to make use of any easy to use GUI tool. QT designer is already
installed on my Linux. Which other GUI frameworks are easy to use for a
Ruby beginner to use? It should have a wide user base so that help is
easily available.
I wrote some ruby-gtk2 code a while back and it was not at all a bad
experience:
I wouldn’t call it widely used outside of Linux, but my code was
portable
to both Windows and OSX. Users of Windows, simply have to install Ruby
and
then install GTK2 libraries.
There should be pretty good docs on the website, but I can give you some
working samples I wrote that deal with gnome notificatiers.
It’s an ever so pleasant DSL built on top of Ruby GTK2, here’s a
sample from the readme:
require 'green_shoes'
Shoes.app( :width => 250, :height => 250 ) do
para 'Hello, world!'
image 'images/shoes.png'
end
All you need to get started is ruby 1.9.2, rubygems 1.5+, and the gtk2
gem (which may be automatically installed for you when installing the
green_shoes gem): then you’re ready to install green_shoes:
gem install green_shoes
The best part, other than the super friendly api, is that your apps
will run on linux and windows without any modification. They may even
work on OSX, but I’m not sure the current state of support for mac.
image ‘images/shoes.png’
will run on linux and windows without any modification. They may even
work on OSX, but I’m not sure the current state of support for mac.
Just tried on Ubuntu 10.04 (in rvm with 1.9.3) and it installed
like a charm The test program also worked immediately.
$ cat Gemfile
source :rubygems
gem ‘green_shoes’
$ bundle install
Fetching source index for http://rubygems.org/
Installing pkg-config (1.1.2)
Installing glib2 (1.1.2) with native extensions
Installing atk (1.1.2) with native extensions
Installing cairo (1.10.2) with native extensions
Installing gdk_pixbuf2 (1.1.2) with native extensions
Installing pango (1.1.2) with native extensions
Installing gtk2 (1.1.2) with native extensions # this took a minute or
so
Installing green_shoes (1.1.354)
Using bundler (1.0.21)
Tip: Some of them are better than the others when dealing with an
specific constraint/objective. In a small project of mine I wrote 3
(simple) GUIs (looking the same) using tk, wxRuby, RubyCocoa.
I want to write a small desktop application on Ruby. I want the
application to be platform independent. I am using Fedora Linux for
building app. but I want the application to run on Windows as well.
hello,
the simpler for Windows is to use the RubyInstaller
(http://rubyinstaller.org/).
it now include TK, so it’s really the
easiest way to go, for Windows.
Have you tried the Glimmer Desktop Development Library for Ruby? Not only does it offer cross-platform support and native-UI, but it also provides a programmer-friendly declarative DSL, data-binding support, scaffolding, and packaging (e.g. make a Mac DMG app file). It was originally presented at RubyConf 2008.
If you’re using Mac OS X then you’d likely want to use MacRuby, which allows you to create desktop apps. I think its one of the cleanest ways to develop for the desktop using Ruby
MacRuby has not been maintained since 2015. Also, I know a developer who hated learning to deal with the Cocoa APIs directly in Ruby so much he thought it was easier to use Swift at that point. But, thankfully, the open-source Glimmer DSL for LibUI comes to the rescue (among other Glimmer GUI toolkits; there are 6 others)! It has won a Fukuoka Ruby 2022 Special Award after getting judged by Matz, the creator of Ruby. It provides a great abstraction DSL that enables building desktop apps for all of Mac, Windows, and Linux with the same simple Ruby codebase. That said, the most complete Glimmer desktop development library is Glimmer DSL for SWT, which runs on JRuby, supporting native executable packaging on Mac (APP/DMG/PKG), Windows (EXE/MSI), and Linux (DEB/RPM). Both options (for CRuby and JRuby) are great entry points into Glimmer GUI desktop development in Ruby.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.