Is Ruby good at GUI develop?

I want to choose a script to develop a GUI program. I want to know more
about Ruby on GUI development, including its performance, function
capability, etc. Does anyone give me a brief introduction on this?

Zhao Yi wrote:

I want to choose a script to develop a GUI program. I want to know more
about Ruby on GUI development, including its performance, function
capability, etc. Does anyone give me a brief introduction on this?

There are assorted C-based options for GUI toolkits (Tk, Fox, wx, GTK,
Qt, etc.). These can be used with the C implementation of Ruby (the one
people think of when then think of Ruby).

You also have Java-based options; Swing in particular, which you can use
with JRuby.

You have to consider what’s important: libraries, available widgets,
documentation, vendor support, layout managers, available WYSIWYG UI
editors, packaging and deployment, if end-users will need to install or
compile something, is it cross-platform, can you create your own
widgets, can you customize existing widgets, and so on.

I help develop a library called Monkeybars, which aims to make building
cross-platform desktop apps as simple and intuitive as the better Ruby
Web frameworks do for Web apps. Monkeybars uses JRuby + Swing, and I
encourage you to give it a whirl. It rocks. But I’m biased.

http://www.monkeybars.org


James B.

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff

James B. wrote:

Zhao Yi wrote:

I want to choose a script to develop a GUI program. I want to know more
about Ruby on GUI development, including its performance, function
capability, etc. Does anyone give me a brief introduction on this?

There are assorted C-based options for GUI toolkits (Tk, Fox, wx, GTK,
Qt, etc.). These can be used with the C implementation of Ruby (the one
people think of when then think of Ruby).

You also have Java-based options; Swing in particular, which you can use
with JRuby.

You have to consider what’s important: libraries, available widgets,
documentation, vendor support, layout managers, available WYSIWYG UI
editors, packaging and deployment, if end-users will need to install or
compile something, is it cross-platform, can you create your own
widgets, can you customize existing widgets, and so on.

I help develop a library called Monkeybars, which aims to make building
cross-platform desktop apps as simple and intuitive as the better Ruby
Web frameworks do for Web apps. Monkeybars uses JRuby + Swing, and I
encourage you to give it a whirl. It rocks. But I’m biased.

http://www.monkeybars.org


James B.

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff

I must say I’m not totally happy with any of the current offerings
that I’ve tried for a Ruby GUI(fxRuby, wxRuby, Shoes, Sugar). I want a
form to open up and I want to be able to drop controls anywhere I want
on to it without having my eyes bleed.

I’d like to have a GUI builder (preferably on Linux, or will run the
built GUI on Linux) that’s as easy as Microsoft Visu … hey would you
guys stop throwing things …please? … anyway as easy as that.

That being said… Monkeybars seems to be the easiest way for me to
build a GUI in Ruby thus far. Hmmmm… I’ll have to look at how
plug-ins are done in Netbeans… It may let me automate creating a
project with a form with Monkeybars.

I’m just a Linux newbie so I’ll just get back to creating my rinky dinky
little apps in Ruby. :stuck_out_tongue: If someone ever does get around to writing a
decent GUI builder for Ruby I predict the flood doors would open and
you’d see everyone and their dog trying Ruby out. Is that a good
things?.. (shrug)

M

2008/9/10 Jason C. [email protected]:

I’d like to have a GUI builder (preferably on Linux, or will run the
built GUI on Linux) that’s as easy as Microsoft Visu … hey would you
guys stop throwing things …please? … anyway as easy as that.

You can use Glade to do this with Ruby-GNOME2.

Farrel

I’d prefer Ruby and Qt4 (qt4-qtruby):
http://rubyforge.org/frs/?group_id=181&release_id=23283

You can use Aptana IDE with Ruby for the Code, the Qt Assistant for
Documentation, and the Qt Designer to build GUIs with a graphical Tool.
Further i dont know any other way to build a GUI for Ruby with a Visual
Designer. Performance is quiet good, cause qt4-qtruby is just a
‘Wrapper’ for the libraries.

Farrel L. schrieb:


Otto Software Partner GmbH

Jan P. (e-mail: [email protected])

Tel. 0351/49723202, Fax: 0351/49723119
01067 Dresden, Freiberger Straße 35 - AG Dresden, HRB 2475
Geschäftsführer: Burkhard Arrenberg, Heinz A. Bade, Jens Gruhl

On Sep 9, 2008, at 7:38 PM, Jason C. wrote:

I’m just a Linux newbie so I’ll just get back to creating my rinky
dinky
little apps in Ruby. :stuck_out_tongue: If someone ever does get around to writing a
decent GUI builder for Ruby I predict the flood doors would open and
you’d see everyone and their dog trying Ruby out. Is that a good
things?.. (shrug)

Jason,
There’s a GUI builder for Ruby already (JRuby, specifically). It’s
Netbeans.
Netbeans has a GUI Builder that supports drag-and-drop of buttons,
panels, labels, etc. If you do it right, you can use your interface on
any platform.

We have some screencasts which are a little dated, but it’ll give you
the gist of using the editor along with how you wire it up with
Monkeybars:
(near the buttom of the page)
http://monkeybars.rubyforge.org/docs.html

We also can be found in #jruby and #monkeybars on freenode.

Jason C. wrote:

I must say I’m not totally happy with any of the current offerings
that I’ve tried for a Ruby GUI(fxRuby, wxRuby, Shoes, Sugar). I want a
form to open up and I want to be able to drop controls anywhere I want
on to it without having my eyes bleed.

I’d like to have a GUI builder (preferably on Linux, or will run the
built GUI on Linux) that’s as easy as Microsoft Visu … hey would you
guys stop throwing things …please? … anyway as easy as that.

NetBeans. Built in GUI editor that Just Works. Cross-platform. Free.
(It’s also a decent Ruby editor as well.)

things?.. (shrug)
Why must the GUI builder be written in Ruby? Monkeybars works with
the resulting .class file(s) containing the Swing stuff; how that gets
created is irrelevant. (Note: yes, you can use Monkeybars with
“builder”-style GUI-generating code as well, but that gets painful for
anything non-trivial, even with Monkeybars.)

Use the best tool for the job. Few people are insisting their text
editor or IDE be written in Ruby (not to say that would be a bad thing,
just misplaced focus).

There will be a Monkeybars talk at RubyConf 2008; I think it will knock
people’s socks off. (Yes, I’m biased. But see for yourself.)


James B.

www.happycamperstudios.com - Wicked Cool Coding
www.jamesbritt.com - Playing with Better Toys
www.ruby-doc.org - Ruby Help & Documentation
www.rubystuff.com - The Ruby Store for Ruby Stuff

I do not quite care about the developing IDE for ruby GUI. What I want
to know is the performance of ruby GUI application. Compare with other
GUI application, like tcl, python etc., is ruby a good choice?

I’d like to have a GUI builder (preferably on Linux, or will run the
built GUI on Linux) that’s as easy as Microsoft Visu …

Don’t fight it :wink:

Drag+drop design for Rails (cross-platform):
http://www.sapphiresteel.com/Visual-Ruby-On-Rails-Drag-and-Drop
http://www.sapphiresteel.com/A-Brief-Guide-To-The-Visual-Rails
http://www.sapphiresteel.com/A-Brief-Guide-To-The-Visual-Rails,235
http://www.sapphiresteel.com/Visual-Rails-Workbench-screencast
http://www.sapphiresteel.com/Visual-Rails-Workbench-The-Import

Drag+Drop design for any .NET program running Ruby:
http://www.sapphiresteel.com/Ruby-and-NET-Making-a-Connection

Drag+Drop Design for Iron Ruby (.NET):
http://www.sapphiresteel.com/Ruby-In-Steel-For-IronRuby

best wishes
Huw C.

SapphireSteel Software
Ruby and Rails In Visual Studio
http://www.sapphiresteel.com

qt4-qtruby is kinda wrapper for Qt4, GUI is nearly same speed as with
C++, cause precompiled libraries are used.

Zhao Yi schrieb:

I do not quite care about the developing IDE for ruby GUI. What I want
to know is the performance of ruby GUI application. Compare with other
GUI application, like tcl, python etc., is ruby a good choice?


Otto Software Partner GmbH

Jan P. (e-mail: [email protected])

Tel. 0351/49723202, Fax: 0351/49723119
01067 Dresden, Freiberger Straße 35 - AG Dresden, HRB 2475
Geschäftsführer: Burkhard Arrenberg, Heinz A. Bade, Jens Gruhl

You can use Glade. I made a software with Ruby + ActiveRecord + Glade

  • Sqlite in a week. This soft I done to learn how program with Ruby in
    stand alone applications. Is a small example of what can somebody do
    with this technologies…

In the bellow link can see explanation of the aplication and download
a screencast about the aplication.

http://cesardiaz.com.ar/personal_page/english/portfolio.html

Cheers


http://www.sindominio.net/ayuda/preguntas-inteligentes.html
http://cronopios.net/Traducciones/trolls.es.html
Gnu/Linux count user #416024

Pagina personal : http://www.cesardiaz.com.ar
Blog://cesarediaz.blogspot.com

Wow. Quite the storm! Oh well.

I guess I should clarify a bit.

I am using monkeybars (and therefore NetBeans) to create my GUI. It’s
pretty good. My second choice would be Glade(Is there a way for Glade 3
to be used?). It’s still a little hit or miss though in NetBeans. I
put some controls down and the rest move … even after I put a panel
in. Of course it could be that I’m an idiot and I don’t know how to
make a GUI with it. :stuck_out_tongue: The more I use it the more I’ll get used to
those quirks.

I also don’t care if the GUI itself is written in Ruby. The GUI could
be written in LOGO for all I care. I just want to write an app, click a
button and have some Ruby code execute behind it.

Q: If I write a swing GUI in NetBeans can I then copy that somehow to a
ruby project(using Monkeybars somehow)? Or do I have to start from
scratch every time. I’m also not entirely sure how to create a project
with two or more forms.

My GUI first app is either going to be a pared down media library/grep
tool for people who like to download (open source of course!) shows and
ask themselves, “Do I download that show? Or do I have it already?” I’m
using JRuby, Monkeybars, NetBeans and Postgres. I’m not too sure about
Activerecord yet and I find SQL rather trivial so I’m accessing the db
directly.

My first Ruby script (which made me fall in love with Ruby) transcoded
all of the avi files in a directory to 320x200 in 1 line of code.

I’m just trying to have fun. :stuck_out_tongue:
M
=:)

On Sep 10, 2008, at 7:02 AM, Jason C. wrote:

panel
in. Of course it could be that I’m an idiot and I don’t know how to
make a GUI with it. :stuck_out_tongue: The more I use it the more I’ll get used to
those quirks.

By default in Netbeans, all panels, frames, dialogs, and other
containers are set to “Free Design”, which is the GroupLayout.
GroupLayout is very quirky, and takes some time to learn. For forms of
any complexity, you may want to use a different layout (right click on
the container in question, and you can set the new layout). If you’re
looking for something akin to Visual Studio’s absolute layout, you can
set the layout to null (Null Layout). This isn’t cross-platform
friendly, and the form won’t move/stretch when the user goes to resize
it, but at least it’ll get you going. You can also isolate some
components by putting them in another panel, and different panels,
even if nested, can have their own layout. Netbeans also has a handy
feature where you can select one or more components, and right click,
and select “Enclose In…” and select a JPanel.

GroupLayout does some really cool things, but sometimes it’s like
working with a mule. It’s very tricky.

project
with two or more forms.

We’ve got a whole more than two forms going in some of our projects:
http://www.happycamperstudios.com/monkeybars/charlotte%20interface.png

I’m not exactly sure what’s going on here, but I’d gather that you
created a Ruby project. Unfortunately, Netbeans doesn’t support a true
JRuby project, where you can freely dance between JRuby and Java. The
next best thing is to make your project a Java project. Here you can
have Ruby files but also Java files and forms. You’ll need a
Main.java, which kicks off JRuby, as well as the JRuby complete jar.
We’ve got a tutorial on setting a lot of this stuff up in our
tutorials section: http://monkeybars.rubyforge.org/tutorials.html

My GUI first app is either going to be a pared down media library/grep
tool for people who like to download (open source of course!) shows
and
ask themselves, “Do I download that show? Or do I have it already?”
I’m
using JRuby, Monkeybars, NetBeans and Postgres. I’m not too sure
about
Activerecord yet and I find SQL rather trivial so I’m accessing the db
directly.

We have a couple of internal Monkeybars project that need their own
local database. We used Derby + ActiveRecord for this. While I didn’t
work a ton on these projects myself, I know we’d be more than happy to
share what we did to get it working. Derby is SQLite in Java, so it’s
just a file that you can load as your database, and there’s no need
for anyone to set up a full on database server on their machine.

2008/9/10 timr [email protected]

unlikely any of the current GUI programming systems out now will be
able to compete with it (on the mac platform).
Tim

Ruby as well as Perl and Python, can use Gtk (multiplatform)

To a demo visit: http://perplex.schmumpf.de/dev/tictactoe/ruby/


Angel A.

F3leR

On Sep 5, 6:20 pm, Zhao Yi [email protected] wrote:

I want to choose a script to develop a GUI program. I want to know more
about Ruby on GUI development, including its performance, function
capability, etc. Does anyone give me a brief introduction on this?

Posted viahttp://www.ruby-forum.com/.

It won’t work for linux users, but I am interested in macruby–an ruby/
Obj-C combination. That should allow ruby users to use ruby style with
Apple’s extensive GUI object library. That will be nice. It is
unlikely any of the current GUI programming systems out now will be
able to compete with it (on the mac platform).
Tim

Logan B. wrote:

We have a couple of internal Monkeybars project that need their own
local database. We used Derby + ActiveRecord for this. While I didn’t
work a ton on these projects myself, I know we’d be more than happy to
share what we did to get it working. Derby is SQLite in Java, so it’s
just a file that you can load as your database, and there’s no need
for anyone to set up a full on database server on their machine.

I’ve got to remember to start with small projects before I go for big
ones.

I think I fubared 3 hours of work on a form.
I get the error: ‘no such file to load – media_window_view’ I have a
MediaWindow_view.rb so I’m scratching my head. I’m trying to find
‘media_window_view’ in my code but no luck so far.

M

On Sep 11, 2008, at 6:29 PM, Jason C. wrote:

I get the error: ‘no such file to load – media_window_view’ I have a
MediaWindow_view.rb so I’m scratching my head. I’m trying to find
‘media_window_view’ in my code but no luck so far.

All of your files should be named with underscores
(media_window_view.rb). The classes are have the camel case
(MediaWindowView).
If you’re like me, and strive to remember as few things as possible,
you can just use the generator task to create these files, and it will
hook them up for you.
rake generate ALL=src/foo
This will create the following
src/foo/foo_model.rb
src/foo/foo_controller.rb
src/foo/foo_view.rb
Each of those files will have a very simple Model, Controller, and
View for you to use that are pretty much ready to go. I think you just
need to fill out the Java class the view where you see set_java_class.

Logan B. wrote:

All of your files should be named with underscores
(media_window_view.rb). The classes are have the camel case
(MediaWindowView).
If you’re like me, and strive to remember as few things as possible,
you can just use the generator task to create these files, and it will
hook them up for you.
rake generate ALL=src/foo
This will create the following
src/foo/foo_model.rb
src/foo/foo_controller.rb
src/foo/foo_view.rb
Each of those files will have a very simple Model, Controller, and
View for you to use that are pretty much ready to go. I think you just
need to fill out the Java class the view where you see set_java_class.

I followed the example on the site and created a working app. I tried
it again but left it for a couple of weeks(before I got the form to
show) then came back to it. I’m going to start from scratch and try to
import the code for the controls for my form. (crosses fingers)

J