GUIs - A Modest Proposal

Stephen Hansen me+list/python at ixokai.io
Mon Jun 14 21:58:00 EDT 2010


On 6/14/10 6:02 PM, AD. wrote:
> On Jun 15, 12:06 pm, Stephen Hansen <me+list/pyt... at ixokai.io> wrote:
>> "Arbitrarily sized" was the key point ;-) In that, you set the sizes of
>> the div's explicitly.
> 
> As I said to Ed, I think you missed why I included the exact same
> image in two divs of different sizes. That was to show it was still
> centered no matter what size the container was. It is even easier to
> fit it to the browser window.

I didn't miss it at all; I just didn't accept (and still don't
-entirely-) that positioning within an explicitly sized div is the same
thing as one which has had a flow-determined size.

But! That said:

> Like so: Create an HTML single image that sits dead in the center of
>> your screen when your browser is maximized. Then if you adjust your
>> browser to be half as wide, its still in the center. Just the new center.
> 
> Even easier than the first example:

Very nice. And interesting. "position: absolute" there is a mystery to
me and seems to be key, I'm not sure entirely what it is doing to the
layout manager in that scenario, but it seems to do the trick.

Much, much, much Googling led me to try many things to get it just
right, and all bemoaned the lack of a solid way to vertically center:
all the while using essentially similar methods to horizontally center.

Anyways. :)

-- 

   Stephen Hansen
   ... Also: Ixokai
   ... Mail: me+list/python (AT) ixokai (DOT) io
   ... Blog: http://meh.ixokai.io/

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 487 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20100614/fc1bdf0b/attachment.sig>


More information about the Python-list mailing list