[GUI] Dynamic ... something

Wolfgang Thaller wolfgang.thaller@gmx.net
Sun, 13 Apr 2003 23:24:36 +0200


(arghh... I keep forgetting to fill out the To: and Cc: fields 
correctly...)

> What are the two Ints? Pixels? Dialog units? Fractions of something? I
> just wonder if it is really simple. Convince me that it is! :-)

Ah those nasty dialog units. I never thought of anything else but 
pixels. But Windows, too, supports placement by pixel coordinates, so 
it's not really a problem.
But I'll not insist on it for now....

> I meant that placing a widget at a specific position will be just an IO
> action like "placeWidget" above. This cannot be expressed by 
> combinators,
> otherwise you already have the dynamic version.

I don't think so. I'd do it like it's done in Apple's Cocoa, i.e. 
specify the initial coordinates + a few flags that specify resizing 
behaviour. I'd use the same combinator or whatever mechanism that is 
used for the "real" layout mechanisms.

First, we need to agree on a general way of how to specify layouts... 
Do we really want combinators, or is that too abstract for our purposes?
I was originally thinking of just using IO actions to add widgets to a 
container or to pass the container on widget creation; and to pass 
along some "layout constraint" (which depends on the container type).
For a container that does grid-based layout, I'd pass a row and column 
number (and perhaps row & column span).
For a container that does "explicit placement" layout, this "layout 
constraint" would just be the bounding rectangle in pixels, plus 
perhaps resizing flags.

If we don't put the "explicit placement" container in the public 
interface, I'll still have it internally in the Mac version - as I 
said, It's useful for implementing the other kinds on top of it.

The first reason why I thought we might want to have explicit placement 
everywhere is that it was my impression that it was easier to implement 
than any "serious" layout manager, even on platforms that already 
provide automatic layout (I might be wrong, though). I would just like 
to have some way to see if I implemented the Mac version of the XYZ 
widget correctly, and to compare it with other platforms, before I had 
all the layout stuff in place. But as I said, I won't insist on it.

Cheers,

Wolfgang