[GUI] Dynamic sizing.

Glynn Clements glynn.clements@virgin.net
Sun, 27 Apr 2003 05:49:23 +0100


Wolfgang Thaller wrote:

> > Motif's "generic" container widget is XmForm. This allows you to place
> > the children arbitrarily, with the edges positioned using attachments.
> 
> I lost track somewhere, but I think I get the drift (and I'll try 
> reading it again tomorrow, when tiredness isn't interfering).
> Is there anything that an XmForm do that Grids can't?

I don't know; my knowledge of grids is pretty rusty. The set of
XmATTACH_* options listed in my previous message should be enough to
determine exactly what you can and can't do with an XmForm.

> I think we should just manually implement a grid-layout manager for the 
> Motif backend.
> An alternative would be to manually implement something like XmForm on 
> all other platforms, but it looks like that is harder than implementing 
> a grid.

Certainly, XmForm is non-trivial. The layout algorithm is iterative;
it repeatedly updates the sizes and positions until all of the
constraints are satisified (or, if you make a mistake and specify
contradictory attachments, until it exceeds the iteration limit).

Personally, I suspect that trying to come up with a portable mechanism
for geometry management is going to be one of the hard parts. OTOH, it
isn't something that programs often need to deal with. Most of the
time, the program itself doesn't actually care where the widgets are;
it just needs to be able to get/set their state, and receive
notification of significant events.

In any case, my bottom line is that, even if you provide a portable
geometry management mechanism, I ought to be able to just use actual
XmForm, XmRowColumn etc widgets for the Motif version of an
application. In particular, stylistic attributes (e.g. spacing,
margins) which are set via resources need to be respected.

-- 
Glynn Clements <glynn.clements@virgin.net>