I never understood why Swing was so slow. I do know, however, that Swing is
VERY powerful, much more than people realize. Anybody who's ever written a
Java application with WebObjects will know what I'm talking about.

However, a native Ruby GUI could be just as powerful, and a fair bit sexier!

For example:

window = Window.new
button = Button.new
def button.activate
	print "Click!"
end
window.add(button)
window.run

Or something like that. The point is that Ruby has an event model already
written for us .. just redefine that instance's method!

Another very cool thing this could lead to is something like this:

PersonFactory = Struct.new("Person", :first_name, :last_name, :iq)

window = Window.new
table = Table.new
table.header = ["First Name", "Last Name"]
table << PersonFactory.new("Joe", "Slopchuck", 210)
table << PersonFactory.new("Some", "Guy", 160)
table << PersonFactory.new("Eli", "Green", 10)
def table.data_for_row(row)
	return [row.first_name, row.last_name]
end
window.add(table)

So table would look something like:

+------------+-----------+
| First Name | Last Name |
+------------+-----------+
| Joe        | Slopchuck |
| Some       | Guy       |
| Eli        | Green     |
+------------+-----------+

Doing this:

table.selected_object

Would return the actual Person object that was inserted previously, giving the
entire environment a very OO feel. The same could be done for ComboBoxes and
Lists and such ... a reference to an object would be stored by the widget, but
the display would be determined by the re-defined format method call.

I'd be willing to take a stab at doing something like this using SDL or some
other platform-neutral framebuffer lib. Anybody else interested?

from Rich Kilmer on 2001-10-26 at 06:19:59:
> I wrote a sophisticated lightweight component framework on Java (before Swing) that was very fast.  Of course, writing it in a "higher level" language adds overhead, but not as much overhead as bad design ;-)  If you could have low-level primitives written natively and layer higher level constructs with Ruby, I think you could build a very responsive UI.
> 
> -Rich
> 
> > -----Original Message-----
> > From: markus liedl [mailto:markus.lado / gmx.de]
> > Sent: Thursday, October 25, 2001 4:23 PM
> > To: ruby-talk ML
> > Subject: [ruby-talk:23350] Re: GUI / was [ANN] RubyInRubyParser
> > 0.1-pre-alpha
> > 
> > 
> > > having a native window with a canvas which Ruby draws on using 
> > the BitBlt 
> > > operation.  From there we can think about a GUI toolkit like 
> > Squeak's, and
> > > other things like that.
> > 
> > matju, and experiences with Java Swing will tell you that this solution is
> > not fast, and will never be. I was surprised, but Swings slowness does not
> > depend on the hardware it runs one, it's just slow. (I have 
> > impressions from
> > using Swing on a k6-2 350,  P3 650, athlon 1.4)
> > 
> > matju's ideas say: get compatibility by the X11 protocol ( which 
> > may not be
> > what windows-guys like).
> > 
> > It's waste of time to copy Java Swing for Ruby.
> > 
> > Surely, it's a nice occassion for you to learn how a certain chip on your
> > graphic card is doing BitBlts, but for serious work, let it do this chip.
> > 
> > markus
> > 
> > -- 
> > -------------------------------------------------

-- 
This will all be on the test. Please study it.
Eli Green
Codedogs