wxNotebook resize problems

Hello, I'm trying to understand how wxNotebook works for automaitc sizing.
I developed a subclass of wxPanel with an add method that dynamically adds controls using a RowColSizer.
If I use it directly in a window I got no problem, using sizers I obtain exactly what I want.
Problems arise when I want to put that panel in a wxNotebook. The notebook keeps its standard size.
Well I nver worked with notebooks.
The problem, to state it in another way is:
I need to add a variable number of controls inside a tab, therefore I don't know the size of the notebook in advance. How can I resize it? I don't need to add controls at runtime, just once.

Thanks,
    Riccardo

rtrocca@libero.it wrote:

Hello, I'm trying to understand how wxNotebook works for automaitc
sizing. I developed a subclass of wxPanel with an add method that
dynamically adds controls using a RowColSizer. If I use it directly
in a window I got no problem, using sizers I obtain exactly what I
want. Problems arise when I want to put that panel in a wxNotebook.
The notebook keeps its standard size. Well I nver worked with
notebooks. The problem, to state it in another way is: I need to add
a variable number of controls inside a tab, therefore I don't know
the size of the notebook in advance. How can I resize it? I don't
need to add controls at runtime, just once.

If you put the notebook in a wxNotebookSizer then it will query the sizers on all the pages to determine the minimum size that the notebook should be. Then if you put it in an enclosing sizer or whatever then the notebook and its contents will be treated more as expected.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks! I was making a silly error: not adding the notebooksizer to the
"global" sizer, but the notebook itself :frowning:
As already noted several times on this list, Robin is doing really an
amazing work!

Riccardo

···

----- Original Message -----
From: "Robin Dunn" <robin@alldunn.com>
To: <wxPython-users@lists.wxwindows.org>
Sent: Wednesday, February 19, 2003 20:42
Subject: Re: [wxPython-users] wxNotebook resize problems

rtrocca@libero.it wrote:
> Hello, I'm trying to understand how wxNotebook works for automaitc
> sizing. I developed a subclass of wxPanel with an add method that
> dynamically adds controls using a RowColSizer. If I use it directly
> in a window I got no problem, using sizers I obtain exactly what I
> want. Problems arise when I want to put that panel in a wxNotebook.
> The notebook keeps its standard size. Well I nver worked with
> notebooks. The problem, to state it in another way is: I need to add
> a variable number of controls inside a tab, therefore I don't know
> the size of the notebook in advance. How can I resize it? I don't
> need to add controls at runtime, just once.
>

If you put the notebook in a wxNotebookSizer then it will query the
sizers on all the pages to determine the minimum size that the notebook
should be. Then if you put it in an enclosing sizer or whatever then
the notebook and its contents will be treated more as expected.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org