[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg
Subject:    Re: Resizing child windows
From:       Glynn Clements <glynn () gclements ! plus ! com>
Date:       2007-08-31 6:01:34
Message-ID: 18135.44734.690550.310425 () cerise ! gclements ! plus ! com
[Download RAW message or body]


matthew.garman@gmail.com wrote:

> If I have a parent window with one or more child windows, and the
> parent window's size is changed (either by the user, due to
> application design/behavior, whatever), what's the typical generic
> method of making sure the children get updated accordingly?
> 
> E.g., how do widget toolkits based on X11 (gtk, qt, etc) tell child
> widgets to resize?
> 
> I'm not looking for exact code, just a general idea.
> 
> I looked through the gtk/gdk sources a bit... it looks like there is
> some kind of queueing going on with size requests and actual size
> allocations... but it wasn't clear to me where these requests are
> first routed, and the path they take through the window hierarhcy.
> Also the queueing/event mechanism wasn't obvious (at a glance
> anyway).

Each container widget has a layout policy which determines the
position and size of each child widget given the size of the
container. The layout policy may have various per-child settings
and/or may ask the child to specify its preferred, minimum and/or
maximum sizes.

The layout policy may be tied to a particular type of container, or
there may be distinct "geometry manager" (aka layout, packer) objects
which are associated with a container.

You should read the documentation for a specific toolkit to determine
how that toolkit handles layout.

-- 
Glynn Clements <glynn@gclements.plus.com>
_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic