Forum: Ruby GUI in C++ or Ruby

F20c503dd31705724c32a1a41b4cde2c?d=identicon&s=25 Don Norcott (rustysam)
on 2013-11-13 21:33
I am just getting back to using Ruby after a 3 year absence (from any
type of programming) and for my next project (strictly personal) I will
be using Ruby to pull data from webpages and filter and massage it with
the end result being a text file with 1 line per item.

I then need a GUI to display the data and make minor changes to the data
and a control file.  But its primary purpose is simply to display the
data in a grid format for external decisions.

I am familiar with C and C++ (but rusty) and had planned use a
windows based C++ program as my GUI

I have seen references to several Ruby based GUI interfaces but know
nothing about them.  From what I have seen so far, either Shoes (wait
for version 4?) or Ruby/TK would  be the ones to look at. There may be
others better suited that I have not found.

I would prefer to use Ruby only for my simple GUI requirements and I am
looking for a Ruby GUI recommendation from someone who has been this
route before.

Any suggestions appreciated
Thanks Don
F20c503dd31705724c32a1a41b4cde2c?d=identicon&s=25 Don Norcott (rustysam)
on 2013-11-13 21:42
I should have mentioned I will be using Windows 8.1 as build machine.

Also would consider using JRuby if necessary as understand it has a very
good GUI in "Swing"?.  But I am not all that familiar with JRuby

Don
C40020a47c6b625af6422b5b1302abaf?d=identicon&s=25 Stefano Crocco (crocco)
on 2013-11-13 22:18
(Received via mailing list)
Excerpts from Don Norcott's message of 2013-11-13 21:33:34 +0100:
> windows based C++ program as my GUI
> Any suggestions appreciated
> Thanks Don
>

I like very much QtRuby, the ruby bindings for the Qt library. There's a
binary gem for windows called qtbindings. Unfortunately, the gem doesn't
include the UI designer. While you can do without it, you can install it
together with Qt itself from http://qt-project.org/downloads (mind to
download the 4.8 version, as the 5.* aren't supported by the bindings).
The library itself is already included in the bindings, but you need it
for the UI designer, called QtDesigner.

The ruby API is very similar to the C++ one, which you can find at
http://qt-project.org/doc/qt-4.8/. Some of the differences are
documented at http://techbase.kde.org/Development/Languages/Ruby (ignore
any KDE references).

I hope this helps

Stefano
F20c503dd31705724c32a1a41b4cde2c?d=identicon&s=25 Don Norcott (rustysam)
on 2013-11-14 02:23
Thanks have had a look at the links above and a couple of other sites.
I will go back and look again once I have explored any others
recommended.

Also looking for any negative comments about bad experiences with GUIs
so I can avoid exploring them.

Don
8e16f7669af5b4ecfa4f2b89f32b21b6?d=identicon&s=25 Stefan Salewski (Guest)
on 2013-11-14 02:36
(Received via mailing list)
On Thu, 2013-11-14 at 02:23 +0100, Don Norcott wrote:
> Thanks have had a look at the links above and a couple of other sites.
> I will go back and look again once I have explored any others
> recommended.
>
> Also looking for any negative comments about bad experiences with GUIs
> so I can avoid exploring them.
>
> Don
>

Of course the GTK+ GUI together with Cairo works very well, at least for
Linux and GTK2, GTK3 support is not much tested.

http://ruby-gnome2.sourceforge.jp/

But for you and Windows Qt may be a better choice...
18813f71506ebad74179bf8c5a136696?d=identicon&s=25 Eric Wong (Guest)
on 2013-11-14 02:42
(Received via mailing list)
Don Norcott <lists@ruby-forum.com> wrote:
> Also looking for any negative comments about bad experiences with GUIs
> so I can avoid exploring them.

http://partmaps.org/era/unix/guis.txt
699c00ad35f2755810b4aa5f423d73e2?d=identicon&s=25 Albert Schlef (alby)
on 2013-11-14 10:41
Don Norcott wrote in post #1127228:
> I would prefer to use Ruby only for my simple GUI requirements and I am
> looking for a Ruby GUI recommendation from someone who has been this
> route before.

My experience says that every GUI toolkit has its drawbacks
(portability,  ease of installation (that's only important if you
distribute your app), uglyness, usability, learning curve), and at the
end of the day using the browser for GUI can solve these issues. You can
use Sinatra.
Ccd9be37f5bd322e9d3968f767328928?d=identicon&s=25 Sebastjan H. (sebastjan_h)
on 2013-11-14 12:51
Albert Schlef wrote in post #1127300:
> Don Norcott wrote in post #1127228:
>> I would prefer to use Ruby only for my simple GUI requirements and I am
>> looking for a Ruby GUI recommendation from someone who has been this
>> route before.
>
> My experience says that every GUI toolkit has its drawbacks
> (portability,  ease of installation (that's only important if you
> distribute your app), uglyness, usability, learning curve), and at the
> end of the day using the browser for GUI can solve these issues. You can
> use Sinatra.

I use Shoes for desktop applications.

Green Shoes is a pure ruby version:
https://github.com/ashbb/green_shoes.

Shoes 4 is still in development: http://shoesrb.com/.


It's easy to learn and use. The Shoes community (shoes@librelist.com) is
also very supportive and helpful.

regards,
seba
14b5582046b4e7b24ab69b7886a35868?d=identicon&s=25 Joel Pearson (virtuoso)
on 2013-11-14 13:08
I've found GTK to be very flexible and quick compared to TCL/Tk.
I experimented with Ruby Shoes but didn't get on with it, although it's
probably moved on since then. GTK2 is my current GUI of choice on
Windows 7.
F20c503dd31705724c32a1a41b4cde2c?d=identicon&s=25 Don Norcott (rustysam)
on 2013-11-14 16:41
Keep them coming I appreciate it.

Just to clarify, these applications will be strictly for my own use and
will not be distributed.

They will be used and built in a Windows environment (build is on Win
8.1)


The purpose of the application is to display data in an easily readable
format so a user can make choices external to the program.  The
application below may get much more complex the GUI will change little.

The app will retrieve data from web pages and create a data file of
items/objects to display. This data changes completely on each run.
A control file (desired or undesired general properties) and a history
file (previously modified objects)are used to remove items or change
their properties.  The result is a file of displayable items.

The purpose of the GUI is to display the items in a grid format that can
be scrolled both vertically and horizontally.  The only user input will
be the ability to select an item in the grid and from a choice on a drop
down menu modify its properties.  This flags it for inclusion in the
history file.

After the GUI is closed the history file is updated and the display item
file is discarded.

Don
14b5582046b4e7b24ab69b7886a35868?d=identicon&s=25 Joel Pearson (virtuoso)
on 2013-11-14 17:03
I'm not sure about the other tools, but it sounds like something that
Gtk's TreeView might be suited to.
34a7615f38496a5dafbb3e6b721c435e?d=identicon&s=25 Mohit Sindhwani (Guest)
on 2013-11-17 17:13
(Received via mailing list)
Hi Don,


On 14/11/2013 11:41 PM, Don Norcott wrote:
> Keep them coming I appreciate it.
** snip **
> The purpose of the application is to display data in an easily readable
> format so a user can make choices external to the program.  The
> application below may get much more complex the GUI will change little.

What you're saying sounds like a good fit even for a locally hosted web
application, especially if you're familiar with a bit of Javascript for
the interactivity.

On the other hand, if you're comfortable with C++, my preference would
have been Embarcadero (Borland) C++ Builder for the GUI, a suitable
database (if it fits, SQLite3) as the intermediate store, and a set of
Ruby scripts to populate the database.  With a defined schema as the
interface, there is no reason for the UI to be built in the same
language (other than the convenience of Ruby).

Best Regards,
Mohit.
F20c503dd31705724c32a1a41b4cde2c?d=identicon&s=25 Don Norcott (rustysam)
on 2013-11-17 19:39
Thanks guys still open to suggestions
B078cb4f4fb473c7a54d1fc36d10c70e?d=identicon&s=25 Regis d'Aubarede (raubarede)
on 2013-11-18 23:57
Don Norcott wrote in post #1127662:
> Thanks guys still open to suggestions

if you don't care very much on look&feel, with Ruiby you can
do this kind of Hmi in few minutes...

see for some exemple (screen copy+code):
http://raubarede.tumblr.com/post/19640720031/currents-work

Then if you care on l&f, see visualruby...
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.