From: Laurent Julliard Date: 2002-02-18T00:08:20+09:00 Subject: Re: The GUI Returns Horacio Lopez wrote: > Hello all, > > > I had a look at a Python project at > http://anygui.sourceforge.net/ > > Quoting them: > "The purpose of the Anygui project is to create an easy-to-use, simple, and > generic module for making graphical user interfaces in Python. Its main > feature is that it works transparently with many different GUI packages on > most platforms. " > > > This sounds very close to a rant we had some weeks ago about what way we > should go if we wanted a coherent standard GUI API that doesn't suck. > I am not sure yet if they will achieve their goals, but it's something to > have an eye on, if they do it with Python, we can do it with Ruby too. > > I am aware of the Ruby-based Locana project, (http://www.locana.org) but it > looks to me like people didn't show much interest on it. > (maybe I am wrong, but I haven't seen many posts on Locana in ruby-talk) > > Again, which way should we go ? (in pain order) > > 1) Full implementation of a Ruby GUI ('a la Swing) ? > I fully second Curt Hibbs' opinion on that one. This would probably be too slow like AWT and SWINGs were (sorry.. are ;-) ) in Java. So I would definitely reject that one. > 2) GUI Abstraction Layer ('a la Locana / Anygui ) > This is to me the most promising route to go. And again I'm fully aligned with Curt's reply (no he did not pay me anything :-). I have looked at the Eclipse project and spent some time investigating the SWT library. SWT is the Eclipse GUI abstraction layer which central idea is to rely on one:one mapping with native widgets thus giving the best of both world a) speed and native OS look and feel, b) A common APIs for all platforms). This is pretty much the same approach as Locana and Anygui but 1) Eclipse is backed by many people including large companies so SWT probably has a chance to emerge as a de facto standard by itself 2) The SWT toolkit is put at work in the Eclipse IDE and it looks like pretty sophisticated GUIs can be generated with SWT. So I don;t think we must feare the "least common denominator" syndrom. 3) Adapting SWT to Ruby is not like if we had to redevelop everything from scratch. Most of the code structure and design used in SWT (which is written in Java) can be re-used as is for Ruby. So it's more a matter of translating the Java code to Ruby (at least to start with). SWT is about 130 000 lines of code (without comments) : 100 000 for Java and 30 000 lines of C code. Now this is for all of SWT which means with the code to run on top of Win32, Motif, GTK and Photon/QNX. Assuming that we the Ruby community are mostly interested by the Win32 and GTK parts this is roughly 50 000 lines of Java code (with comment) to rewrite in Ruby. Not a small project but if a couple of people decide to join their forces this would be easily feasible. > 3) Give up, code for one toolkit and resign being fully cross-platform > (or code for different toolkits and platforms, a coder's nightmare) > No, no, no!!! > 4) Don't do GUIs > Hey that's an option... I personnally love command line and xterm but it looks like this is really waht most people use these days. I'm a pragmatic programmer so I know this fourth sceanrio has no future. > > > Just thinking out loud, what's your opinion ? > Since I'm a member of the FreeRIDE project and I know that FreeRIDE members always have this GUI toolkit question in a corner of their mind I'd be tempted to say that it would be great to have RubySWT available. Or at least we could give it a try and build a quick mockup to see if it flies. Anybody interested? Laurent