[wxPython] Sizing in 2.1.14

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[wxPython] Sizing in 2.1.14

Udo Floegel
Hallo,

just updated from 2.1.11 to 2.1.14 I see some Differences in the sizing
behavior.

A notebook sized via parent.GetClientSize() is displayed in 2.1.11
filling the
parent-frame, with the new version it remains small with scrolls until
I've
changed the framesize per mouse. A tree which is a child of the notebook
is
after expanding old:(80,200) in contraire with new version (-1,-1).

Which is the right strategy for sizing/resizing the application,
specially when
some things like a sash postion shall depend from a child which has not
a fix
size ?
How I can force actualisation of the scrollbar for a wxScrolledWindow
(as a notebook-child)
when its content (and therefore its size) are changed throug the
application ?
When I resize the window the scrolls are updated.

regards, Udo.



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users



Reply | Threaded
Open this post in threaded view
|

Re: [wxPython] Sizing in 2.1.14

Robin Dunn
>
> just updated from 2.1.11 to 2.1.14 I see some Differences in the sizing
> behavior.
>
> A notebook sized via parent.GetClientSize() is displayed in 2.1.11
> filling the
> parent-frame, with the new version it remains small with scrolls until
> I've
> changed the framesize per mouse. A tree which is a child of the notebook
> is
> after expanding old:(80,200) in contraire with new version (-1,-1).

I'm not sure I follow your explaination, but I hope this helps:

1. A frame with only one child will automatically set the size of that child
to fill the client area, unless the EVT_SIZE event is caught and you do
something different there.

2. Depending on platform and window type, a window may not have an actual
size until the underlying native window/widget has been created or possibly
until it has been shown.  Hence doing a GetClientSize() in a frame's __init__
may not give you a meaningful value.  Because of this you should use some
other way to do positioning or sizing of child windows such as the various
auto layout mechanisms, or absolute positioning/sizing in a EVT_SIZE handler.

3. Page windows in a notebook should always be automatically sized to fill
the page area.  If they are not then it is a bug.  A couple things to watch
out for are that the page should be the child of the notebook, not some other
window.  The other thing is if the page window contains sub windows or
controls, then the notebook will not manage their size, only the page window.
It is up to the page window to manage the sizing of its children, either via
autolayout or doing something in an EVT_SIZE handler.

>
> Which is the right strategy for sizing/resizing the application,
> specially when
> some things like a sash postion shall depend from a child which has not
> a fix
> size ?

Look at the samples and docs for Sizers and Constraints.


> How I can force actualisation of the scrollbar for a wxScrolledWindow
> (as a notebook-child)
> when its content (and therefore its size) are changed throug the
> application ?
> When I resize the window the scrolls are updated.
>

There are some examples of this in the library.  Look at wxMVCtree and
wxEditor.

--
Robin Dunn
Software Craftsman
[hidden email]
http://AllDunn.com/robin/
http://AllDunn.com/wxPython/  Check it out!



_______________________________________________
wxPython-users maillist  -  [hidden email]
http://starship.python.net/mailman/listinfo/wxpython-users