From: MonkeeSage Date: 2007-11-28T05:30:06+09:00 Subject: Re: "Why I Program In Ruby (And Maybe Why You Shouldn't)" On Nov 27, 2:12 pm, MenTaLguY wrote: > On Wed, 28 Nov 2007 04:40:00 +0900, MonkeeSage wrote: > > So that's 5 major toolkits (or 6 if you count pure Swing, but I don't > > know to what extent it implements native widgets; I think it's kind of > > got its own look/feel and themes)...at *least* three of which are > > production quality and support native look and feel across platforms > > (SWT, WxWidgets, GTK). > > In terms of look and feel, Swing is at least as "native" as Gtk is; both > use theme engines rather than wrapping actual native widgets. The main > difference is that GTK normally defaults to a theme emulating the native > look and feel, whereas most distributions of Swing (except the bundled > one on OS X) do not. It's easy to force Swing to use the native look > and feel though: > > require 'java' > UIManager = Java.javax.swing.UIManager > UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName) > > ..the last line of which you could also write: > > UIManager.look_and_feel = UIManager.system_look_and_feel_class_name > > (This IS Ruby, dammit.) > > One other advantage of Swing over Gtk is the OS X support -- on OS X, > if the com.apple.macos.useScreenMenuBar runtime property is set to > true your application will use the system menu bar for menus, which is > not (as far as I know) yet possible with Gtk. > > One downside to Swing on Windows is that the native Win32 theme lacks > some refinement (mostly odd padding choices), although Java 7 promises > to improve that situation. > > -mental Nice. I've only played a little bit with JRuby, no GUI stuff, just basics (my work is non-technical, so I've only used Java/Jruby/and lately Scala as a hobby); other than that, I haven't run any Java apps for quite some time. I just remembered a purple-ish sort of UI akin to old macs (mac 7 or 8?). > UIManager.look_and_feel = UIManager.system_look_and_feel_class_name I like how the setter is automatically initialized. :) Regards, Jordan