Resizing child windows

Carsten Haitzler (The Rasterman) raster at rasterman.com
Thu Aug 30 15:58:49 PDT 2007


On Thu, 30 Aug 2007 15:57:25 -0500 matthew.garman at gmail.com babbled:

> 
> 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.

there is nothing that happens to them automatically in X - they stay where they
are at the size they are. if the parent got bigger - lots of extra blank space
is there. if it got smaller, they get clipped. any other resize behavior is
entirely dependent on actual code and calculations in each widget set, and
that in turn is based on how the widgets are packed (placed) and configured.
e.g. does  the child of a parent container expand or not? does a child fill
its allocated space or not? is the container homogenous? etc.

> 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).

the window hierarchy is irrelevant. it's the widget hierarchy that counts. a
widget may or may not map to a window. widget != window.

> Any tips would be much appreciated,
> Thank you,
> Matt
> 
> _______________________________________________
> xorg mailing list
> xorg at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/xorg
> 


-- 
------------- Codito, ergo sum - "I code, therefore I am" --------------
The Rasterman (Carsten Haitzler)    raster at rasterman.com
裸好多
Tokyo, Japan (東京 日本)



More information about the xorg mailing list