Widget toolkits - layout methodolgy

Hello all, I got a few questions and ideas I want to throw out there.
First thing I want to talk about is layout in Tk, Gtk and WxWidgets. Ideally I'd like to use Gtk, because a) its the toolkit I'm most familiar with, and b) I like its api the best. This is mitigated
by the fact that I've moved from Linux to OS X, and I'd like to be cross-platform without being "weird" (ie, I don't want people to have install an X server unless its on an OS without an alternative "native" GUI interface, in which case they already have one probably). This brought me to Tk, but the layout choices I find kind of weird. I REALLY liked Gtk's HBox and VBox, setup, and while Tk has many options including a grid layout, (which I could use like HBox and Vbox sort of) this does not (appear) to be one of them. This made me look at WxWidgets, which does have that style of layout but I find the api to be really ugly, personally (although Tk isn't exactly "pretty"). Last time I looked at Fox, it had the same "ugly" API issue, although I haven't looked at it recently, and both Tk and WxWidgets have the native look thing going for them. So anyone have any alternate suggestions?

The reason I am in such a widget conudrum is that after building a personal app in rails, it started to make me think about MVC more, and rails whole framework setup. This made me wonder if the same "rails" style methods could be applied to desktop apps. I was also inspired by the CSS/HTML/Javascript setup. This led me to the project I am currently working on, which would be a RAD framework for Ruby. Original I was going to have the interface layouts in .xml but then I thought, hey I can do this as a DSL. (One syntax to rule them all). Currently I have code that lets stuff like this work

% cat a.rb
window :id => 'main_win', :title => "Hello World" do
      label :caption => "Hello, world!"
end

or even

% cat b.rb
window :title => "Hello" do
       hbox do
           label :caption => "Hello, world"
           button :caption => "Ok", :action => :some_action
       end
end

I feel like hbox and vbox style layouts would be more simpler for the user than having to do things like

grid do
       row do
               widget :param => value
        end
end
  Although it would not be hard to provide that functionality as well as hboxes and vboxes. I guess this boils down to is there a Tk equivalent to HBox and VBox?
  And, would anyone use this? I personally think its quite cool.

I don't know much about Tk, but I'm finding Qt/KDE programming with Korundum
to be quite nice. Perhaps a healthy include 'qt' is in order? (all your
HBox VBox stuff is there and it is actually really clean in ruby)

···

On Wednesday 21 September 2005 20:18, Logan Capaldo wrote:

  Although it would not be hard to provide that functionality as well
as hboxes and vboxes. I guess this boils down to is there a Tk
equivalent to HBox and VBox?

Message-ID: <ADA66963-B91B-4F53-A376-5B87B8DC9386@gmail.com>

of weird. I REALLY liked Gtk's HBox and VBox, setup, and while Tk has
many options including a grid layout, (which I could use like HBox
and Vbox sort of) this does not (appear) to be one of them. This made

Please see TkHBox and TkVBox class of "ext/tk/sample/tkalignbox.rb"
(You'll be able to find it in Ruby's source archive).
Can those classes satisfy you?

···

From: Logan Capaldo <logancapaldo@gmail.com>
Subject: Widget toolkits - layout methodolgy
Date: Thu, 22 Sep 2005 11:18:35 +0900
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Partly because any discussion it may provoke may help me, have you considered
Qt (and QtRuby (or RubyQt) and Korundum)? For a different reason, I'm
leaning towards moving into that world. (The different reason is that I
think I may be able to build what I'm after by some amount of modification to
Quanta Plus.) (Including some functionality, I hope, implemented in Ruby.)

Randy Kramer

···

On Wednesday 21 September 2005 10:18 pm, Logan Capaldo wrote:

Hello all, I got a few questions and ideas I want to throw out there.
First thing I want to talk about is layout in Tk, Gtk and WxWidgets.

Hmm, I hadn't really considered Qt until just now, but looking at troll tech site looks like its got native look and feel for win and mac and the ruby api looks clean. I think you have helped me select a winner

···

On Sep 22, 2005, at 1:10 AM, Kevin Brown wrote:

On Wednesday 21 September 2005 20:18, Logan Capaldo wrote:

  Although it would not be hard to provide that functionality as well
as hboxes and vboxes. I guess this boils down to is there a Tk
equivalent to HBox and VBox?

I don't know much about Tk, but I'm finding Qt/KDE programming with Korundum
to be quite nice. Perhaps a healthy include 'qt' is in order? (all your
HBox VBox stuff is there and it is actually really clean in ruby)

I will definitely check those out. Thanks

···

On Sep 22, 2005, at 1:55 AM, Hidetoshi NAGAI wrote:

From: Logan Capaldo <logancapaldo@gmail.com>
Subject: Widget toolkits - layout methodolgy
Date: Thu, 22 Sep 2005 11:18:35 +0900
Message-ID: <ADA66963-B91B-4F53-A376-5B87B8DC9386@gmail.com>

of weird. I REALLY liked Gtk's HBox and VBox, setup, and while Tk has
many options including a grid layout, (which I could use like HBox
and Vbox sort of) this does not (appear) to be one of them. This made

Please see TkHBox and TkVBox class of "ext/tk/sample/tkalignbox.rb"
(You'll be able to find it in Ruby's source archive).
Can those classes satisfy you?
--
Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

I just got around to actually looking at those classes, and they look like exactly what I wanted. Same license as ruby for this code, correct? Thanks for this code.

···

On Sep 22, 2005, at 1:55 AM, Hidetoshi NAGAI wrote:

From: Logan Capaldo <logancapaldo@gmail.com>
Subject: Widget toolkits - layout methodolgy
Date: Thu, 22 Sep 2005 11:18:35 +0900
Message-ID: <ADA66963-B91B-4F53-A376-5B87B8DC9386@gmail.com>

of weird. I REALLY liked Gtk's HBox and VBox, setup, and while Tk has
many options including a grid layout, (which I could use like HBox
and Vbox sort of) this does not (appear) to be one of them. This made

Please see TkHBox and TkVBox class of "ext/tk/sample/tkalignbox.rb"
(You'll be able to find it in Ruby's source archive).
Can those classes satisfy you?
-- Hidetoshi NAGAI (nagai@ai.kyutech.ac.jp)

Glad to help... Do please note that currently the ruby bindings for Qt/KDE
libraries are under the GPL, meaning that if you want to produce a commercial
application, that's out of the question, and the other fact that if you
produce a commercial app with Qt, you need to pay the licensing fee ('troll
tax').

If you're doing GPL work, then just ignore this, I'm largely throwing it out
there for people that don't know or google and find our thread.

All that said, I think Qt is a very strong framework, and worth the fee, it's
just a matter of getting ahold of a commercially licensed Korundum that's an
issue at this point.

···

On Wednesday 21 September 2005 23:29, Logan Capaldo wrote:

On Sep 22, 2005, at 1:10 AM, Kevin Brown wrote:
> On Wednesday 21 September 2005 20:18, Logan Capaldo wrote:
>> Although it would not be hard to provide that functionality as well
>> as hboxes and vboxes. I guess this boils down to is there a Tk
>> equivalent to HBox and VBox?
>
> I don't know much about Tk, but I'm finding Qt/KDE programming with
> Korundum
> to be quite nice. Perhaps a healthy include 'qt' is in order?
> (all your
> HBox VBox stuff is there and it is actually really clean in ruby)

Hmm, I hadn't really considered Qt until just now, but looking at
troll tech site looks like its got native look and feel for win and
mac and the ruby api looks clean. I think you have helped me select a
winner

Hello Logan,

Hmm, I hadn't really considered Qt until just now, but looking at
troll tech site looks like its got native look and feel for win and
mac and the ruby api looks clean. I think you have helped me select a
winner

I tried QT on MacOSX and i must say i still don't like it. For MacOSX
there is nothing like a cross platform tool available. What you can do
is to create nib files that abstract layout, a few platform dependent
methods and then use them to develop code.

Maintaining three different full native GUI applications is much less work
then many people expect if you start coding from the beginning on
these platforms. I whished somebody had told me this before.

···

--
Best regards, emailto: scholz at scriptolutions dot com
Lothar Scholz http://www.ruby-ide.com
CTO Scriptolutions Ruby, PHP, Python IDE 's

Logan Capaldo wrote:

  Although it would not be hard to provide that functionality as well
as hboxes and vboxes. I guess this boils down to is there a Tk
equivalent to HBox and VBox?

I don't know much about Tk, but I'm finding Qt/KDE programming with
Korundum
to be quite nice. Perhaps a healthy include 'qt' is in order?
(all your
HBox VBox stuff is there and it is actually really clean in ruby)

Hmm, I hadn't really considered Qt until just now, but looking at
troll tech site looks like its got native look and feel for win and
mac and the ruby api looks clean. I think you have helped me select a
winner

The Qt3 version of QtRuby runs on Linux, BSD* etc and Mac OS X, but not
Windows. The latest version is part of the KDE 3.5 release.

The Qt4 version of Qt is GPL'd for Windows, and so QtRuby will run on
Windows once someone with a suitable mingw development environment can do
the port. It's pretty much ready for a first release. The code is here:

https://svn.kde.org/home/kde/trunk/KDE/kdebindings

under the kalyptus, smoke/qt and qtruby directories.

-- Richard

···

On Sep 22, 2005, at 1:10 AM, Kevin Brown wrote:

On Wednesday 21 September 2005 20:18, Logan Capaldo wrote: