Desktop multi-plataform ruby app

Thank you very much for your time an explanations.
It looks like by switching to JRuby one would actually gain functionalities.
Also, since at the moment I don't have any truly number crunching appls
which would really benefit from a faster Ruby, I would give JRuby a try this
weekend.
I guess I would have to uninstall Ruby. That's not a big deal!

Again, thank you for your time and consideration.

Victor

···

On Fri, Jun 6, 2008 at 11:08 PM, James Britt <james.britt@gmail.com> wrote:

Victor Reyes wrote:

On Fri, Jun 6, 2008 at 4:15 PM, Charles Oliver Nutter < >> charles.nutter@sun.com> wrote:

Israel Guerra wrote:

Hail everyone!

This is my first post here. :slight_smile:

I want to develop a desktop app that runs in either linux or windows.
I have many doubts about which GUI i should use. What's the best option?
I
heard about wxwidgets or tk, but have no idea of what i should use.

I would prefer something that has a graphical app that can help me
creating
the visual part.

JRuby + Swing + NetBeans Matisse + MonkeyBars

- Charlie

Can JRuby coexist with C-Ruby?

Yes, more or less. There are jruby equivalents of gem, rake, and I rename
them to jgem and jrake so that I don't accidentally call the wrong one.

Does anyone have any performance numbers of Ruby vs JRuby?

Would any JRuby appl with GUI run on any *NIX server that supports Java?

Should. If the app bundles up the needed jars (swing, or swingx, for
example) to handle the UI then all the end user needs is a jre.

Is there a drag and drop widgets creation GUI design under JRuby with

Swing?

The Matisse GUI editor than comes with NetBeans 6, all free, is great.

I think VxRuby or something to that effect is the only GUI environment

that
offers drag/drop widget creation. Not sure though!

You get that from Matisse as well.

Currently I am running Ruby 1.8.7 and on some servers I am playing 1.9.

What
is the equivalent version of JRuby to the latest level of Ruby?

Um, 1.8.6, though I *think* there are some things planned for 1.9 that are
already in JRuby (such as hash.first).

How far behind is JRuby from Ruby (C-Ruby)?

Charlie should answer that one, but people are using it for production
apps.

If I am not mistaken, Monkeybars is only an MS/Windows appl, correct?

Oh, far from it. I develop on Kubuntu, David and Logan are on Macs, and
our main customer is all WinXP.

It really is cross-platform.

Monkeybars is Ruby code that knows how to hook into Swing via JRuby and
wicked use of Java reflection.

Also check out rawr, a tool that helps in packaging and deploying JRuby
apps.

http://gitorious.org/projects/rawr

--
James Britt

http://www.ruby-doc.org - Ruby Help & Documentation
http://www.rubystuff.com - The Ruby Store for Ruby Stuff

James,

I would recommend the same.

There is also the command whereis:

whereis java

I can't remember, but i think it shows only where the binary is. Anyway you
could try that.

···

On Sat, Jun 7, 2008 at 2:44 PM, Hassan Schroeder <hassan.schroeder@gmail.com> wrote:

On Sat, Jun 7, 2008 at 10:02 AM, Tom Cloyd <tomcloyd@comcast.net> wrote:

> So, onward, again. I try to install Netbeans 6 for Linux. Says it want a
JDK
> (the dread starts now). I'm on Kubuntu, so I go to Adept, <snip/>

:preface => I hate *nix package managers :slight_smile:

I think you'd be better off downloading a JDK from Sun and installing
it the normal way, so you /know/ where it's located. Then the rest of
the NetBeans install should be a piece of cake...

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

--
Guerra

:preface => I hate *nix package managers :slight_smile:

The main reason I still use *nix is because of package managers.

I think you'd be better off downloading a JDK from Sun and installing
it the normal way, so you /know/ where it's located.

Huh?

$ which java
/usr/bin/java
$ dpkg -L sun-java6-jdk
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/sun-java6-jdk
/usr/share/doc/sun-java6-jdk/README.html
/usr/share/doc/sun-java6-jdk/README.alternatives
/usr/share/doc/sun-java6-jdk/copyright
/usr/share/doc/sun-java6-jdk/changelog.Debian.gz
/usr/share/applications
/usr/share/applications/sun-java6-jconsole.desktop
(LONG output snipped -- run it yourself)

Maybe it could be easier, but I can, in fact, get a list of every single file
a package has installed -- or every single file it will installed, before I
do. Usually I use packages.ubuntu.com, but that seems to be down right now...

···

On Saturday 07 June 2008 12:44:46 Hassan Schroeder wrote:

Leslie Viljoen wrote:

I understand your dread - I have the same dread, and the same problems getting
Java + XYZ to work. I actually currently have a Netbeans install that
I have tried
to use the built-in plugin installer to install Ruby support - after
incomprehensible
errors it knows nothing of Ruby. Busy re-downloading. I tried monkeybars and the
tutorials for a few hours and failed completely. Perhaps it is very
good, but it is
surely also very complicated.

If you honestly believe that then we (the Monkeybars crew) have failed someplace, perhaps in the docs or the screencasts, because the last thing we want is anything complicated.

Now, granted, I'm biased (I'm a Monkeybars contributer and have been building production apps with it for almost a year), but if you can tell me (off-list, perhaps) what you thought was complicated, I will see what I can do to help you out.

···

--
James Britt

"Tear it up and start again."
  - Anonymous

James Britt wrote:

Tom Cloyd wrote:

This all sounds very interesting, and I want to investigate it, but I dread having to deal with the java monster. I've been there before.

So have I. And David created Monkeybars to avoid all that.

Seriously, you can write desktop apps that use Swing and run under JRuby and never look at a line of Java. That's basically the whole point.

We wanted whatever was good we could glom from Java, while avoiding having to write any actual Java ourselves.

Forty-five+ versions, all with 26 letter names, and documentation that requires a masters in CS to decypher. I simply cannot know everything, and I'm pretty committed in a couple of other fields. Still, I have programming to get done, and drag and drop GUI that doesn't require yet another book to read would be a blessing.

Monkeybars. It uses reflection and naming conventions to interact with the UI components so that you stick to Ruby.

So, onward, again. I try to install Netbeans 6 for Linux. Says it want a JDK (the dread starts now). I'm on Kubuntu, so I go to Adept, find sun-jave6-jdk - nothing else looks more likely - and install it. Now Netbeans says it can't find it and I need to point the way. Huh? Don't have a clue.

Better off grabbing the JDB+NetBeans bundle from netbeans.org, then once installed telling NetBeans to install the Ruby plugins.

There is a screencast on monkeybars.org that goes through the installation of NetBeans:

http://monkeybars.rubyforge.org/tutorials/netbeans.html

Yeah, I'm sold. Did a brief scan of the website and immediately liked what I saw. Monkeybars looks slick. Heck, *I* might even be able to understand it! Hope springs eternal, yessir. So, I'm all installed and ready to have a swing at it, as soon as I find a free moment.

All the dependencies, etc., DOES look (in the mind) a bit scary, but I've found that if one give the Big Boys a few months, they generally get things wired together so they Just Work. And beyond that, there's the marvelous Ruby community. Rare has been the time that I haven't gotten an answer back to whatever problem I've posted about - in under an hour. Phenomenal, actually. The rest of life should be so good!

t.

···

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Israel Guerra wrote:

I hardly believe that an interpreter made in java running on a jvm will be
as fast as a C interpreter.

1 thing could cause that and would be a very bad work made on the CRuby and
i don't believe that's the case.

The truth is that the convenience of the JRuby is ok for most end uses.

Try JRuby yourself and see. If it's not faster, file it as a bug. We are working very hard to make JRuby as fast as possible.

- Charlie

Dear Monkeybars developers,

how did you produce the videos ?

Thanks.

Best regards,

Axel

···

--
Psssst! Schon vom neuen GMX MultiMessenger gehört?
Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger

Victor Reyes wrote:
> Can JRuby coexist with C-Ruby?
y-nice.

> Currently I am running Ruby 1.8.7 and on some servers I am playing 1.9. What
> is the equivalent version of JRuby to the latest level of Ruby?

Almost nobody is asking for 1.9 features, so we've only taken a marginal
interest. If people want those features, it wouldn't take more than a
couple dedicated weeks to get them in.

It seems that Ruby-1.8.7 has many features from ruby-1.9.
I think it's important to support these as soon as possible.
It seems obvious that this is going to come without asking for it.
As you, at sun staff are going a great job around jruby: no need
to ask for obvious feature... we know that it will be done some day
(no emergency).

But, about GUI tool kit, one thing that would be realy (realy) great
is to port the standard Tk tool kit to java. this would make it
possible
to migrate native Ruby/Tk application to Jruby.

The big part of this work seems to already be done by Bruce Johnson
with it's swank package (port of tk to java for use with jacl (port
of TCL language to java)
- http://www.onemoonscientific.com/swank/index.html
- https://swank.dev.java.net/
- Swank
If Tk whould be port to java, then Tk would be easier to install for
jruby
than for ruby!)

About other Gui toolkit, it seems that there is some confusion
between
true Gui user interface with complex event handling abilities
(key, mouse, ...) and power canvas drawing features with event binding
(like Tk and other) and just html forms like toolkit with some
graphic
capabilities.

I think it's easiest to switch a programm from one (stuctures or oo)
language to another language, than to move from one Gui system to
another
one in the same language.
So the choice of a Gui toolkit is important!

About startup jruby time:

mdiam wrote:

...jruby is still a litle slower than ruby at startup time, because
of the JVM)

In 1.1.2 we have hopefully improved that...for me, startup time went
from 1.5s to about .6s, which is a great improvement. Others have
reported similar boost, maybe not as great. Work continues.

Yes I confirm the great startup improvemnt of the last jruby version,
but I had
to find some inconvenient of jruby ower ruby (but the big one is
about
native library bindings like Tk!)

-- Maurice

···

On Jun 8, 9:44 am, Charles Oliver Nutter <charles.nut...@sun.com> wrote:

Team,

*Tristin*: I already tried the suggestion of FxRuby plus other GUIs. The
documentation for FxRuby was so so. I am the type that learn by example.
*Hassan*: I'll give it a try without un-installing "regular" Ruby.
*Tom*: I am also terrified of the Java T-Rex. So many packages, so many ways
to configure it, so many .....
         I went to

found the soft requirements. I proceeded to Sun site and downloaded a
ton of software: JDK, JRE, NetBeans, Etc. My installation went fine. The
problem is when I try something as simple as jruby -v (I do ruby -v for
regular ruby, so I assume the same is valid for jruby only with the prefix
j). I got the msg:

       Set JAV_HOME to point to your JDK/JRE directory.
I am using MS Windows XP and I set the variable. So now it works as long as
I am inside the *C:\jruby-1.1.2\bin* dir. I tried setting the PATH but
nothing.
*C:\jruby-1.1.2\bin>jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]

*I set the PATH but nothing. Perhaps I am not setting the PATH correctly. So
this is my new show-stopper. I will continue playing until I either get it
or get tired. Although I am already getting tired. This is not supposed to
be this difficult. But dealing with Java nothing is ever simple.
*Leslie*: Does Glade provides a drag/drop widget creation feature? I went to
*glade.gnome.org* but could not find anything about it.
*Charles*: That's a good feature I see useful. "Java is Java and so the same
GUI will basically work as-is on any *NIX". One thing that worries me
though, the JRuby site states that JRuby supports "almost" all the Ruby
classes. I have Ruby 1.8.6 running in well over 100 production AIX Servers.
If I convert to JRuby and need to ensure that current scripts will still
work under it. Is there any docs stating what's not support in JRuby which
is in Ruby?

Well, I am about to reboot my desktop and see if that will fix my problems.
I did not rebooted after the NetBeans installation.

Thanks everyone!

Victor

···

On Sun, Jun 8, 2008 at 8:20 AM, Michael T. Richter <ttmrichter@gmail.com> wrote:

On Sat, 2008-06-07 at 05:57 +0900, James Britt wrote:

If you have questions, jump on #monkeybars on irc; the Monkeybars squad is usually about and very happy to answer questions.

Which network? Freenode? The #monkeybars channel there has no topic and
one person idling in it. :slight_smile:

  --
*Michael T. Richter* <ttmrichter@gmail.com> (*GoogleTalk:*
ttmrichter@gmail.com)
*Never, ever, ever let systems-level engineers do human interaction design
unless they have displayed a proven secondary talent in that area. Their
opinion of what represents good human-computer interaction tends to be a bit
off-track. (Bruce Tognazzini)*

mdiam wrote:

It seems that Ruby-1.8.7 has many features from ruby-1.9.
I think it's important to support these as soon as possible.
It seems obvious that this is going to come without asking for it.
As you, at sun staff are going a great job around jruby: no need
to ask for obvious feature... we know that it will be done some day
(no emergency).

Are people upgrading to 1.8.7? We started adding those features, but there seemed a lot of confusion about whether 1.8.7 was going to be popular or whether people would move to it quickly. But we'll get those features into 1.1.3 or 1.1.4 if people really want/need them.

But, about GUI tool kit, one thing that would be realy (realy) great
is to port the standard Tk tool kit to java. this would make it
possible
to migrate native Ruby/Tk application to Jruby.

The big part of this work seems to already be done by Bruce Johnson
with it's swank package (port of tk to java for use with jacl (port
of TCL language to java)
- http://www.onemoonscientific.com/swank/index.html
- https://swank.dev.java.net/
- Swank
If Tk whould be port to java, then Tk would be easier to install for
jruby
than for ruby!)

I'd love to see someone try to wire this into JRuby, but to date almost nobody has wanted to use Tk after trying JRuby with Swing. If you thought it might be interesting to you, there's some suggestions below on how to get started.

I think it's easiest to switch a programm from one (stuctures or oo)
language to another language, than to move from one Gui system to
another
one in the same language.
So the choice of a Gui toolkit is important!

I agree wholeheartedly. And selecting a GUI framework is a decision you don't want to have to make multiple times. I certainly consider Swing to be powerful...sometimes over-powerful. But I can't imagine what you'd be able to do in another toolkit you can't do in Swing. Plus tools like Monkeybars and Matisse make it really easy.

Beyond that...Tk UIs are a lot harder to make pretty than Swing UIs. Check out some of the great Swing skinning sites:

https://substance.dev.java.net/ (beautiful UIs)
http://napkinlaf.sourceforge.net/ (particularly cute)
http://www.pagosoft.com/products/pgslookandfeel/index.html?sid=4b6ebdac204dd4dfc00b45de4bc3fd3b
http://www.jgoodies.com/
https://liquidlnf.dev.java.net/

Adn there's dozens more out there.

Yes I confirm the great startup improvemnt of the last jruby version,
but I had
to find some inconvenient of jruby ower ruby (but the big one is
about
native library bindings like Tk!)

Native library support is probably the most obvious feature missing, but in my opinion Ruby's C API is the largest thing holding it back. Yes, it's great you can wire in libraries directly to Ruby. But by exposing all the internal types, structures, functions, and macros used to manipulate Ruby directly it's nearly impossible to make the drastic changes Ruby needs to survive (like a new garbage collector, impossible because current extensions access memory directly).

There are several options, however:

- Use a Java library

Tk, for example, is pretty well covered by Swing frameworks for JRuby. And the number of Java libraries available is legendary. You don't even need to use any Java...just load them and call them from Ruby.

- Port the library to Java

This requires some Java knowledge, but it's usually far easier than writing a library in C.

- Use a foreign function interface

JRuby ships with JNA, which is a Java API for programmatically loading and calling any C library from Java with only a bit of pre-built JNI code involved (we ship JNA with support for linux 32/64, solaris sparc/x86, os x and windows). Using this library directly is one way to call out to specific C libraries. There's an example on jna.dev.java.net.

Another alternative would be to help finish up JRuby's support for Rubinius's FFI API, which is basically an improved DL library, or in other terms a full Ruby equivalent to JNA. We have a mostly complete library that we just need to wire in and test. You can inquire on the JRuby list if you'd like to help.

Personally, I'd love to see people stop using the native Ruby API and prefer FFI libraries for all extension writing, since those native extensions are both holding Ruby back and limited to the C impl. And even though both Rubinius and JRuby have starts on implementing that C API through various tricks, those tricks will not be able to cover the entire API and will never perform as well as we would like.

C API == bad. FFI == good.

- Charlie

Michael T. Richter wrote:

···

On Sat, 2008-06-07 at 05:57 +0900, James Britt wrote:

If you have questions, jump on #monkeybars on irc; the Monkeybars squad is usually about and very happy to answer questions.

Which network? Freenode? The #monkeybars channel there has no topic
and one person idling in it. :slight_smile:

Well, it's Sunday, and I just got back home. I confess that IRC support on the weekends is less than ideal.

Folks can E-mail me if they can't get help on irc.

--
James Britt

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

Yazmin Cardenas wrote:

HELLLLLOOOOUU

I ´m still seeking for a Ruby on rails developer for a Job in San

Fco........

1) Thread hijacking doesn't help with that.

2) 'An emergency on your part does not constitute an emergency on my part.'

- --
Phillip Gawlowski
Twitter: twitter.com/cynicalryan
Blog: http://justarubyist.blogspot.com

~ - You know you've been hacking too long when...
...your speech is punctuated by finger twitches (or arm-waving)
indicating braces.

Indeed.
I was thinking about the efficiency.

The question would be: If i will use a JVM, is it worth using an interpreter
running on another interpreter just because i want to program in ruby?

It's probabily ok for small and non processing demanding apps.
:slight_smile:

···

On Fri, Jun 6, 2008 at 6:39 PM, Charles Oliver Nutter < charles.nutter@sun.com> wrote:

Israel Guerra wrote:

But guys, maybe im wrong about jruby, but its a ruby interpreter running
in
the jvm isnt it?

So the final app needs a jvm (obviously), am i right?

Yeah, but that's a pretty minor requirement. There's free (as in beer AND
speech) JVMs easily installable on any plaform (including through the usual
packaging mechanisms).

- Charlie

--
Guerra

No, jruby executable is call jruby!

Just unarchive the last jruby distrib and add the bin/jruby to your
PATH. Then you can use either old ruby or new jruby as you like.

You also can start your jruby script with the firt line:
#!/usr/bin/env jruby
as any standard unix script.

If you alreadu have some (non gui) ruby script, you
can just replace "ruby" by "jruby" is the first line
and see by your self the performance.

(but jruby is still a litle slower than ruby at startup time, because
of the JVM)

- Maurice

···

On Jun 7, 2:48 pm, Victor Reyes <victor.re...@gmail.com> wrote:

I guess I would have to uninstall Ruby. That's not a big deal!

No, not necessary at all.

···

On Sat, Jun 7, 2008 at 5:48 AM, Victor Reyes <victor.reyes@gmail.com> wrote:

I guess I would have to uninstall Ruby.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Israel Guerra wrote:

I would recommend the same.

There is also the command whereis:

whereis java

I can't remember, but i think it shows only where the binary is. Anyway you
could try that.

So, onward, again. I try to install Netbeans 6 for Linux. Says it want a
      

JDK
    

(the dread starts now). I'm on Kubuntu, so I go to Adept, <snip/>
      

:preface => I hate *nix package managers :slight_smile:

I think you'd be better off downloading a JDK from Sun and installing
it the normal way, so you /know/ where it's located. Then the rest of
the NetBeans install should be a piece of cake...

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Thanks Hassan, and Israel, for you help. The matter resolved itself when I restarted the Netbeans installation. Since I installed the JDK right after NB complained about not finding it, and DIDN'T start the install from scratch, but merely backed up a couple of windows and came forward again, it still couldn't find the JDK, post install. With a fresh start, this time, it did.

I'm in business.

I agree at least in part with your comment about package installers. Something they're quicker though.

t.

···

On Sat, Jun 7, 2008 at 2:44 PM, Hassan Schroeder <hassan.schroeder@gmail.com> > wrote:

On Sat, Jun 7, 2008 at 10:02 AM, Tom Cloyd <tomcloyd@comcast.net> wrote:

--

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tom Cloyd, MS MA, LMHC
Private practice Psychotherapist
Bellingham, Washington, U.S.A: (360) 920-1226
<< tc@tomcloyd.com >> (email)
<< TomCloyd.com >> (website & psychotherapy weblog)
<< sleightmind.wordpress.com >> (mental health issues weblog)
<< directpathdesign.com >> (web site design & consultation)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I don't think you failed, and it's not that the process is complex,
it's that the whole setup is
complex. I think Matisse is a fantastic GUI builder and have been
eagerly waiting for it to
support Ruby for ages now (even spoke to the developer for a while) so
I am glad there's
finally a solution for wiring it into Ruby. It's just that Ruby + Java
+ Packages + Netbeans + dependencies + MVC framework + updating + etc.
is a very slow 50 step process with a
huge number of dependencies.

I have just now finished that process for the second time and I still
don't have anything to see.
I must have missed something. I watched all the videos and followed
all the tutorials here:
http://monkeybars.rubyforge.org/tutorials.html

The last page seems to be here:
http://monkeybars.rubyforge.org/tutorials/netbeans.html .. which talks
about RAWR. Rawr install just seems to have added to my Rakefile, and
I don't know what to do now. Do I start making forms? Do I run one of
the RAWR tasks? The link at the bottom of that page points back to
"using the generator" which I have already done. The link after that
is an overview page which is rather long and sounds good but still
doesn't get me to just plain connect a form to my app!

When I got to this point before I started looking at the view,
thinking that it would be somehow related to a form I might build with
Matisse. I tried putting things into the quotes after set_java_class.

If I click "run" now I get to choose something to do with RAWR from a
combo box and then I get:

init:
deps-jar:
Created dir: /home/lesliev/dev/ruby-gui/demo/build/classes
Compiling 1 source file to /home/lesliev/dev/ruby-gui/demo/build/classes
/home/lesliev/dev/ruby-gui/demo/src/org/rubyforge/rawr/Main.java:11:
package org.jruby does not exist
import org.jruby.Ruby;
/home/lesliev/dev/ruby-gui/demo/src/org/rubyforge/rawr/Main.java:12:
package org.jruby.javasupport does not exist
import org.jruby.javasupport.JavaEmbedUtils;
/home/lesliev/dev/ruby-gui/demo/src/org/rubyforge/rawr/Main.java:19:
cannot find symbol
symbol : class Ruby
location: class org.rubyforge.rawr.Main
    Ruby runtime = JavaEmbedUtils.initialize(new ArrayList(0));
/home/lesliev/dev/ruby-gui/demo/src/org/rubyforge/rawr/Main.java:19:
cannot find symbol
symbol : variable JavaEmbedUtils
location: class org.rubyforge.rawr.Main
    Ruby runtime = JavaEmbedUtils.initialize(new ArrayList(0));
4 errors
BUILD FAILED (total time: 2 seconds)

So you see, it's complicated.

Les

···

On Sat, Jun 7, 2008 at 11:20 PM, James Britt <james.britt@gmail.com> wrote:

Leslie Viljoen wrote:

I understand your dread - I have the same dread, and the same problems
getting
Java + XYZ to work. I actually currently have a Netbeans install that
I have tried
to use the built-in plugin installer to install Ruby support - after
incomprehensible
errors it knows nothing of Ruby. Busy re-downloading. I tried monkeybars
and the
tutorials for a few hours and failed completely. Perhaps it is very
good, but it is
surely also very complicated.

If you honestly believe that then we (the Monkeybars crew) have failed
someplace, perhaps in the docs or the screencasts, because the last thing we
want is anything complicated.

Now, granted, I'm biased (I'm a Monkeybars contributer and have been
building production apps with it for almost a year), but if you can tell me
(off-list, perhaps) what you thought was complicated, I will see what I can
do to help you out.

Great man!
I will really try it.

To be fair with monkeybars, i think it's the easier way to have a mvc + gui
"drag and drop" designer.

Thanks everyone for help. :slight_smile:

···

On Sun, Jun 8, 2008 at 4:35 AM, Charles Oliver Nutter < charles.nutter@sun.com> wrote:

Israel Guerra wrote:

I hardly believe that an interpreter made in java running on a jvm will be
as fast as a C interpreter.

1 thing could cause that and would be a very bad work made on the CRuby
and
i don't believe that's the case.

The truth is that the convenience of the JRuby is ok for most end uses.

Try JRuby yourself and see. If it's not faster, file it as a bug. We are
working very hard to make JRuby as fast as possible.

- Charlie

--
Guerra

Glade is a form builder, it allows you to drop containers onto forms
and Gtk widgets
into those containers. This is not the same as with Netbeans or Visual Studio,
but you can get the same results and in some ways the system is better
- it takes better care of how forms change when text is translated or
fonts changed.

You may find it has a learning curve in the beginning, but only until
you understand
how things work, after that it's quick and easy.

I'm putting together a 5-minute tutorial but I'll include the text
portion below
to get you started. The tutorial uses the "glader" script which I'll
include at the bottom.

Warning: I haven't tried glader in Windows yet!

Starting out with Glade and Ruby

···

On Sun, Jun 8, 2008 at 4:19 PM, Victor Reyes <victor.reyes@gmail.com> wrote:

On Sun, Jun 8, 2008 at 8:20 AM, Michael T. Richter <ttmrichter@gmail.com> > wrote:

On Sat, 2008-06-07 at 05:57 +0900, James Britt wrote:

If you have questions, jump on #monkeybars on irc; the Monkeybars squad is usually about and very happy to answer questions.

Which network? Freenode? The #monkeybars channel there has no topic and
one person idling in it. :slight_smile:

  --
*Michael T. Richter* <ttmrichter@gmail.com> (*GoogleTalk:*
ttmrichter@gmail.com)
*Never, ever, ever let systems-level engineers do human interaction design
unless they have displayed a proven secondary talent in that area. Their
opinion of what represents good human-computer interaction tends to be a bit
off-track. (Bruce Tognazzini)*

Team,

*Tristin*: I already tried the suggestion of FxRuby plus other GUIs. The
documentation for FxRuby was so so. I am the type that learn by example.
*Hassan*: I'll give it a try without un-installing "regular" Ruby.
*Tom*: I am also terrified of the Java T-Rex. So many packages, so many ways
to configure it, so many .....
        I went to
Apache NetBeans archive
found the soft requirements. I proceeded to Sun site and downloaded a
ton of software: JDK, JRE, NetBeans, Etc. My installation went fine. The
problem is when I try something as simple as jruby -v (I do ruby -v for
regular ruby, so I assume the same is valid for jruby only with the prefix
j). I got the msg:

      Set JAV_HOME to point to your JDK/JRE directory.
I am using MS Windows XP and I set the variable. So now it works as long as
I am inside the *C:\jruby-1.1.2\bin* dir. I tried setting the PATH but
nothing.
*C:\jruby-1.1.2\bin>jruby -v
ruby 1.8.6 (2008-05-28 rev 6586) [x86-jruby1.1.2]

*I set the PATH but nothing. Perhaps I am not setting the PATH correctly. So
this is my new show-stopper. I will continue playing until I either get it
or get tired. Although I am already getting tired. This is not supposed to
be this difficult. But dealing with Java nothing is ever simple.
*Leslie*: Does Glade provides a drag/drop widget creation feature? I went to
*glade.gnome.org* but could not find anything about it.

------------------------------------------

Open glade.

1. Add a new window, common -> border width: 10
2. Add a vbox to the window (2 items), general -> spacing: 10
3. Add a hbox to the bottom area, general -> spacing: 10
4. Right-click hbox in tree, add parent, alignment
5. Put a button in each of the two bottom blocks
6. On the alignment container, horizonal scale: 0, vertical scale: 0,
horizontal alignment: 1
7. On the alignment container, expand: no, fill: no

If expand is no, the area does not take on more space when the parent grows.
If expand is yes, the area will grow with its parent, and 'fill'
controls how it grows.
If 'fill' is yes, extra space is added around the widgets, otherwise
the extra space
goes inside the widget and the widget itself grows.

8. Add a table in the top space
9. table, packing -> expand: no, general -> row spacing: 10, column spacing: 10

Before saving, click on window1, signals -> gtkobject -> destroy and select
"on_window1_destroy" from the combo.

Now save as "designation" and run "./glader designation.glade" from
the command line.
After generation, run "ruby designation.rb"

Note that when you resize, everything still looks good except the
three labels, which
shouldn't grow horizontally like that.
Also, since you added the on_window1_destroy signal, you can close the
window and your
Ruby program will exit nicely (glader wrote a handler for that).

Return to Glade.

1. label1, packing -> fill: deselect expand
2. Do the same for the other two labels
3. Save

Now re-run designation.rb. You don't have to regenerate since the class and main
file will not change, only the form definition (glade) file. If you
resize you'll
see that the labels now stay small and only the text fields and combo
boxes grow,
which is nice.

----------------------- glader.rb
#!/usr/bin/ruby -w

# This class is a quick way of creating a runnable Ruby program from
# a single Glade form.
#
class Glader
  def initialize(glade_filename)
    raise ArgumentError.new("File missing: #{glade_filename}") if
!File.exist?(glade_filename)
    raise ArgumentError.new("Not a .glade file: #{glade_filename}") if
glade_filename !~ /.*\.glade/

    @glade_filename = glade_filename
    @base_filename = File.basename(@glade_filename, ".glade")
    @class_filename = @base_filename + "_glade.rb"
  end

  # Runs the ruby-glade-create-template script to create a file with a
  # class that corresponds to the form. This can be called repeatedly
  # to keep creating the class every time the .glade file changes.
  #
  def make_class
    `/usr/bin/ruby-glade-create-template #{@glade_filename} > #{@class_filename}`
    @class_filename
  end

  # Creates a main program that uses the glade class created with
  # _make_class_ and opens the window with the form. It will do nothing
  # if the main program file already exists, since the user is likely
  # to add code to this file.
  #
  def make_main
    main_filename = @base_filename + '.rb'

    if(File.exist?(main_filename))
      raise ArgumentError.new("#{main_filename} already exists, skipping")
    else
      File.open(main_filename, "w") {|f| f.write generate_main}
    end
    main_filename
  end

  private
  def generate_main()
    class_name = File.read(@class_filename).scan(/class (.*)/).to_s
    window_id = File.read(@glade_filename).scan(/class="\w+"
id="(\w*)">$/).flatten[0]

    main =<<END

require '#{@base_filename}_glade'

class #{class_name}
  def form
    @glade["#{window_id}"]
  end

  def show
    form.show
  end

  #if this signal exists, exit nicely
  #
  def on_#{window_id}_destroy(widget)
    Gtk.main_quit
  end
end

form = #{class_name}.new("#{@glade_filename}", nil, "Application")
form.show

Gtk.main

END
  end
end

if __FILE__ == $0
  if ARGV.length != 1
    puts
    puts "This script creates a class and a main program that shows a
window using"
    puts "that class from a .glade file. It can be used to quickly
generate a functional Ruby"
    puts "program from a .glade file"
    puts
    puts "Usage: #{__FILE__} <file.glade>"
    puts
    exit
  end

  glader = Glader.new(ARGV[0])
  print "Making class file (#{glader.make_class})...\n"

  begin
    print "Making main file (#{glader.make_main})...\n"
  rescue => e
    puts e.message
  end
  puts

end

Victor Reyes wrote:

*Charles*: That's a good feature I see useful. "Java is Java and so the same
GUI will basically work as-is on any *NIX". One thing that worries me
though, the JRuby site states that JRuby supports "almost" all the Ruby
classes. I have Ruby 1.8.6 running in well over 100 production AIX Servers.
If I convert to JRuby and need to ensure that current scripts will still
work under it. Is there any docs stating what's not support in JRuby which
is in Ruby?

Continuation support is the only major class intentionally missing. As far as general features go, the other big one is that we don't support C-based extensions, but usually there's a Java library that does just as well. Just about everything else should be there. If it's missing, we want to add it. If it's not working correctly, we want to fix it.

- Charlie