On Wed, Jun 25, 2008 at 2:44 PM, Logan Barnett <logustus / gmail.com> wrote:
> Martin,
> I'm one of the contributors to Monkeybars, which is our JRuby GUI framework
> that sits on top of Swing.
> Here's how Monkeybars handles this:

Thanks for the examples - Monkeybars looks pretty cool.

> 4. A container that takes a collection of widgets and lays them out
> according to some userdefined algorithm
> There's a ton of ways to do this using Swing using Layouts.
> Your example: A pure-ruby implementation of a wrapbox
> (http://zem.novylen.net/ruby/wrapboxdemo.png)
> This works out of the box just by using a FlowLayout in your container. That
> can be as simple as this:
> @main_view_component.layout = Java::javax::swing::FlowLayout.new

Yes, but my point was, can you define your own Layout in ruby?

> You _could_ write Java if you wanted, but we haven't run into occurrences
> where Java (the language) is needed. You could write all of your designs by
> hand in Ruby, which is fine. My preferred approach is to use a designer
> tool, such as Netbeans.
> Do you really want to lay something like this out by hand?
> http://www.happycamperstudios.com/monkeybars/charlotte%20interface.png

Actually, I do :) My preferred approach is to build widgets from the
bottom up, so that if I want to experiment with the layout later I can
do it easily in the code. Does netbeans use the "interface definition
file" approach or does it generate actual code from your UI?


> You're in JRuby, and that means you're in Java. Java buys you a built-in JIT
> engine. JRuby's team has told everyone to flag occurrences where MRI is
> faster as bugs. You also can run your code on any machine with Java
> installed, and it's hard to find machines without Java. Monkeybars itself is
> just a jar that happens to be a library. No Ruby installation is needed!
> Leveraging Rawr you can also wrap your jars in .exes or .app files.

This is indeed a huge plus.

> I know a lot of the Ruby community has some bitterness towards Java, but
> this isn't Java the language we're using here, it's Java the platform. I
> encourage anyone interested in GUI development to take a peak at our
> examples and screencasts:

No real bitterness - it's just a language I'd prefer not to use. The
JVM itself I'm all for.

martin