Hello, I created a notedbook with some buttons and other controls. When I change the notebook to multiline and execute my program, the controls on the notebook look strange. When I resize the frame everything moves to where it should and looks ok. When I view the notebook in the editor it looks and behaves ok. I attached my code. What might be happening here? Thanks.
Jeff
App1.py (440 Bytes)
Frame1.py (6.08 KB)
Hi Jeff,
Adding the notebook to a boxsizer with proportion 1 and wx.EXPAND and do a setsizer for it on the frame fixes this.
See you
Werner
Jeff Peery wrote:
···
Hello, I created a notedbook with some buttons and other controls. When I change the notebook to multiline and execute my program, the controls on the notebook look strange. When I resize the frame everything moves to where it should and looks ok. When I view the notebook in the editor it looks and behaves ok. I attached my code. What might be happening here? Thanks.
Jeff
------------------------------------------------------------------------
Thanks Werner, I know that some controls don’t need sizers, for example if I put a panel withing a frame. A notebook does need a sizer though if it is placed within a frame? thanks for the help, its much appreciated.
Jeff
···
“Werner F. Bruhin” werner.bruhin@free.fr wrote:
Hi Jeff,
Adding the notebook to a boxsizer with proportion 1 and wx.EXPAND and do
a setsizer for it on the frame fixes this.
See you
Werner
Jeff Peery wrote:
Hello, I created a notedbook with some buttons and other controls.
When I change the notebook to multiline and execute my program, the
controls on the notebook look strange. When I resize the frame
everything moves to where it should and looks ok. When I view the
notebook in the editor it looks and behaves ok. I attached my code.
What might be happening here? Thanks.
Jeff
To unsubscribe, e-mail:
wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
Jeff Peery wrote:
Thanks Werner, I know that some controls don't need sizers, for example if I put a panel withing a frame. A notebook does need a sizer though if it is placed within a frame? thanks for the help, its much appreciated.
This is from the docs:
If the frame has exactly one child window, not counting the status and toolbar, this child is resized to take the entire frame client area. If two or more windows are present, they should be laid out explicitly either by manually handling wxEVT_SIZE or using sizers <wx_sizeroverview.html#sizeroverview>
A notebook is not special from this aspect.
Laci
ok thanks. I added a sizer to my frame and added the notebook to it. it doesn’t seem to solve the problem of the initial sizing. I attached my code. Any ideas? thanks!
App1.py (440 Bytes)
Frame1.py (6.4 KB)
···
László Nagy nagylzs@freemail.hu wrote:
Jeff Peery wrote:
Thanks Werner, I know that some controls don’t need sizers, for
example if I put a panel withing a frame. A notebook does need a
sizer though if it is placed within a frame? thanks for the help, its
much appreciated.
This is from the docs:
If the frame has exactly one child window, not counting the status and
toolbar, this child is resized to take the entire frame client area. If
two or more windows are present, they should be laid out explicitly
either by manually handling wxEVT_SIZE or using sizers
A notebook is not special from this aspect.
Laci
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
Well I did find that I was adding a sizer using AddWindow, I changed these to AddSizer for adding a sizer to a sizer. alhtough this didn’t seem to fix my trouble. I attached my code. there are two areas that cause trouble. one is that the sizers overlap the multiline notebook tabs, the other is that the static text controls in the “line” notebook page are initially off in a corner. Only when the frame is resized do the controls go to where they should be. I’m not sure why this is happening.
Jeff
Frame2.py (15.4 KB)
···
László Nagy nagylzs@freemail.hu wrote:
Jeff Peery wrote:
Thanks Werner, I know that some controls don’t need sizers, for
example if I put a panel withing a frame. A notebook does need a
sizer though if it is placed within a frame? thanks for the help, its
much appreciated.
This is from the docs:
If the frame has exactly one child window, not counting the status and
toolbar, this child is resized to take the entire frame client area. If
two or more windows are present, they should be laid out explicitly
either by manually handling wxEVT_SIZE or using sizers
A notebook is not special from this aspect.
Laci
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
Hi Jeff,
Adding the following sizer.Fit does the trick this time:
def __init__(self, parent):
self._init_ctrls(parent)
self.bsFrame.Fit(self)
Don't ask me to explain this, my tactic with sizers is trial and error 
See you
Werner
Jeff Peery wrote:
···
ok thanks. I added a sizer to my frame and added the notebook to it. it doesn't seem to solve the problem of the initial sizing. I attached my code. Any ideas? thanks!
*/László Nagy <nagylzs@freemail.hu>/* wrote:
Jeff Peery wrote:
> Thanks Werner, I know that some controls don't need sizers, for
> example if I put a panel withing a frame. A notebook does need a
> sizer though if it is placed within a frame? thanks for the
help, its
> much appreciated.
This is from the docs:
If the frame has exactly one child window, not counting the status
and
toolbar, this child is resized to take the entire frame client
area. If
two or more windows are present, they should be laid out explicitly
either by manually handling wxEVT_SIZE or using sizers
A notebook is not special from this aspect.
Laci
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
thanks Werner, that seems to do the trick.
···
“Werner F. Bruhin” werner.bruhin@free.fr wrote:
Hi Jeff,
Adding the following sizer.Fit does the trick this time:
def init(self, parent):
self._init_ctrls(parent)
self.bsFrame.Fit(self)
Don’t ask me to explain this, my tactic with sizers is trial and error 
See you
Werner
Jeff Peery wrote:
ok thanks. I added a sizer to my frame and added the notebook to it.
it doesn’t seem to solve the problem of the initial sizing. I attached
my code. Any ideas? thanks!
/László Nagy / wrote:
Jeff Peery wrote:
Thanks Werner, I know that some controls don’t need sizers, for
example if I put a panel withing a frame. A notebook does need a
sizer though if it is placed within a frame? thanks for the
help, its
much appreciated.
This is from
the docs:
If the frame has exactly one child window, not counting the status
and
toolbar, this child is resized to take the entire frame client
area. If
two or more windows are present, they should be laid out explicitly
either by manually handling wxEVT_SIZE or using sizers
A notebook is not special from this aspect.
Laci
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail:
wxPython-users-help@lists.wxwidgets.org
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org