On Mon, 2 Aug 1999, Kiran Jonnalagadda wrote:

> I like the Gtk layout method. It makes it very easy to construct forms
> that look good no matter what settings the user has applied. And it also
> takes out the hassle of handling form resizing.

When I wrote that the layout philosophy is "weird", I did not mean to
deprecate it. No doubt, there are some advantages to the way GTK makes you
work while designing a GUI for your application. But there are some
disadvantages, too.  

Firstly, it takes more time. Having worked with both the XForms designer
(fdesign) and Glade, I know that creating a GUI in fdesign is quicker and
takes less time than in Glade. 

Secondly, the resizing policy may lead to strange effects. When a user
resizes your application's window, he/she generally does not want all
elements to expand in the same ratio. If the programmer is not careful,
everything, including the buttons, expands in proportion. Try it with the
GIMP toolbar window after an image is loaded, and see how all the buttons
resize. The bitmaps within the buttons, however, *don't* resize.

Thirdly, when an application is being designed, the programmer experiments
with widgets in various positions and sizes, frequently changing the GUI. 
GTK forces you to have a firm design on paper before you start (the manual
also advises the same thing), because modification is not very easy
whereas fdesign allows you to modify the GUI on the screen as you work.

> For those in the dark, Gtk uses containers and objects just like any other
> interface builder. The difference is that you cannot choose to position an
> object at an arbitary position within a container (like X = 5, Y = 10).
> You can ONLY have the object occupy ALL of the container.

This description is correct, with the addition that there can be
containers within containers. A toolkit, however, should allow me to
choose a position I want, and not force me to occupy some specific place.

> Containers aren't simple rectangular boxes. They are divided into
> free-sizing sections with each section containing either one object or one
> container.

A container changes its size along with the window. So what you thought
was a just-right button on the left becomes large and ugly when you change
the size of the main window to make room for that larger size text-box on
the right.

> Certain objects like labels resize to occupy the least space they can.
> When placed in a container, the specific section of the container adjusts
> its size to match that of the object.

If the label is a bitmap (see the behaviour in GIMP), then it does not
resize automatically. 

> This method of defining interfaces is rather similar to what Java
> provides. The concept and result is the same: good looking interfaces no
> matter what the platform and environment settings.

You get a good-looking GUI with any well designed toolkit. However,
different toolkits make you work differently, and give you different
degrees of freedom in creating your GUI. The point is to get your program
working, whichever toolkit you use.

Kartik. 

Reply via email to