I have a control buried down inside of a hierarchy of sizers on a
dialog. I want to change the size of that control. When I do this, I
want the location of the other controls to adjust accordingly, but this
doesn't happen. Is there a way to get this to happen, and if so, how?
Is there any way to get a handle to the sizer assigned to a particular
window? Is there any way to get handles to the children (windows and
sizers) of a sizer, besides storing them yourself as you add them?
I have a control buried down inside of a hierarchy of sizers on a
dialog. I want to change the size of that control. When I do this, I
want the location of the other controls to adjust accordingly, but this
doesn't happen. Is there a way to get this to happen, and if so, how?
The sizers only pay attention to the size of a window when it is first added
to the sizer. After that they assume that they are the only ones setting
the size of the window. You can still influence it however by calling
sizer.SetItemMinSize(window, width, height)
but it has to be the specific sizer the window was Add()ed to. It won't do
recursive searches through sub-sizers.
Is there any way to get a handle to the sizer assigned to a particular
window? Is there any way to get handles to the children (windows and
sizers) of a sizer, besides storing them yourself as you add them?
If the sizer was set in the window with SetSizer then you can call
GetSizer(), but if the window was just Add()ed to the sizer then no.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
>
> I have a control buried down inside of a hierarchy of sizers on a
> dialog. I want to change the size of that control. When I do this, I
> want the location of the other controls to adjust accordingly, but this
> doesn't happen. Is there a way to get this to happen, and if so, how?
The sizers only pay attention to the size of a window when it is first added
to the sizer. After that they assume that they are the only ones setting
the size of the window. You can still influence it however by calling
sizer.SetItemMinSize(window, width, height)
but it has to be the specific sizer the window was Add()ed to. It won't do
recursive searches through sub-sizers.
Thanks very much for the pointer to the correct routine. This worked great for
me.
I even found that I COULD pass it the overall toplevel sizer, and it found its
way down
to my control (the docs said that it would, so I tried it).
>
> Is there any way to get a handle to the sizer assigned to a particular
> window? Is there any way to get handles to the children (windows and
> sizers) of a sizer, besides storing them yourself as you add them?
>
If the sizer was set in the window with SetSizer then you can call
GetSizer(), but if the window was just Add()ed to the sizer then no.
This became a non-issue (but still interesting to know) when I found I was able
to use
the toplevel sizer to resize a buried window.
Thanks again.
Joe Garbarino jgarb@erim-int.com
Veridian Systems Division