Now, I am not exactly married to the "always stick stuff into a panel"
approach, but I was wondering what was going on here. Perhaps
I'm supposed to use sizers?
Mhm, probably "married" is a very big word , but I always found easier to put stuff inside a wx.Panel than inside a wx.Frame. Moreover, almost all the controls behave erratically when directly placed inside a frame. One exception is wx.Notebook (at least on Windows), and I think also wx.ScrolledThings. In any case, if you want to put the notebook inside the panel, I would go with sizers with something like this:
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Donn Ingle
Sent: 11 May 2006 15:03
To: wxpython-users@lists.wxwidgets.org
Subject: [wxPython-users] Who framed the notebook?
PLATFORM:
Fedora Core 3 (Linux i686 AMD Athlon)
Python 2.3 and 2.4 depending on the Gods of the command-line.
wxPython, as reported by rpm -qa | grep wxPython
wxPython2.6-gtk2-unicode-2.6.3.2-fc2_py2.3
OUTLINE
Hello again! Colourful thread titles aside, I have a short question:
I am trying to use a notebook control for the first time.
After much head scratching and hacking, I have found that if
I put a notebook directly into a frame it will display okay,
if I put the notebook into a panel on the frame it will not.
Now, I am not exactly married to the "always stick stuff into a panel"
approach, but I was wondering what was going on here. Perhaps
I'm supposed to use sizers?
Code attached. A small change at the end can switch between
frame/panel approach to see what I mean.
This behaviour is the same under Linux and Windows XP Home
(SP2). I can't give the Windows specs of wxPython because I'm
at my Linux box at the moment.
Mhm, probably "married" is a very big word , but I always found easier
to put stuff inside a wx.Panel than inside a wx.Frame. Moreover, almost
all the controls behave erratically when directly placed inside a frame.
One exception is wx.Notebook (at least on Windows), and I think also
wx.ScrolledThings. In any case, if you want to put the notebook inside the
panel, I would go with sizers with something like this:
sizer.Layout()
Ah right. I forgot this line when I tried to use a sizer. Thanks.
Hi Andrea,
I have heard a similar statement before:
quote: "Moreover, almost all the controls behave erratically when directly placed inside a frame."
Could you elaborate on this please ?
I'm puzzle by this - I'm using wxWindows (now wxWidgets) for 5 years now and I don't remember any "official word" from the documentation on this !
Is this statement based on "cross platform porting experience" ?
Thanks
Sebastian Haase
Gavana, Andrea wrote:
···
Hello Donn,
Now, I am not exactly married to the "always stick stuff into a panel"
approach, but I was wondering what was going on here. Perhaps I'm supposed to use sizers?
Mhm, probably "married" is a very big word , but I always found easier to put stuff inside a wx.Panel than inside a wx.Frame. Moreover, almost all the controls behave erratically when directly placed inside a frame. One exception is wx.Notebook (at least on Windows), and I think also wx.ScrolledThings. In any case, if you want to put the notebook inside the panel, I would go with sizers with something like this:
_________________________________________
Andrea Gavana (gavana@kpo.kz)
Reservoir Engineer
KPDL
4, Millbank
SW1P 3JA London
Direct Tel: +44 (0) 20 717 08936
Mobile Tel: +44 (0) 77 487 70534
Fax: +44 (0) 20 717 08900
Web: http://xoomer.virgilio.it/infinity77
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Donn Ingle
Sent: 11 May 2006 15:03
To: wxpython-users@lists.wxwidgets.org
Subject: [wxPython-users] Who framed the notebook?
PLATFORM:
Fedora Core 3 (Linux i686 AMD Athlon)
Python 2.3 and 2.4 depending on the Gods of the command-line.
wxPython, as reported by rpm -qa | grep wxPython
wxPython2.6-gtk2-unicode-2.6.3.2-fc2_py2.3
OUTLINE
Hello again! Colourful thread titles aside, I have a short question:
I am trying to use a notebook control for the first time. After much head scratching and hacking, I have found that if I put a notebook directly into a frame it will display okay, if I put the notebook into a panel on the frame it will not.
Now, I am not exactly married to the "always stick stuff into a panel"
approach, but I was wondering what was going on here. Perhaps I'm supposed to use sizers?
Code attached. A small change at the end can switch between frame/panel approach to see what I mean.
This behaviour is the same under Linux and Windows XP Home (SP2). I can't give the Windows specs of wxPython because I'm at my Linux box at the moment.
Donn.
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwidgets.org
For additional commands, e-mail: wxPython-users-help@lists.wxwidgets.org
I don’t know how the situation is now with wxPython (almost 2.7) and wxWidgets 2.7, but not very far in the past [1] I saw quite a lot of problems in placing controls directly on a frame. I am not talking about controls like wx.Panel, wx.Notebook, wx.SplitterWindow obviously. These are usually “containers”. I wrote that sentence about controls like wx.TextCtr, wx.Choice, wx.RadioButton and all the “simpler” widgets.
By reading those messages and experiencing on my own skin the troubles caused by placing the widgets directly on a Frame, I switched almost instantaneously to my current approach: place the controls on a wx.Panel, wx.ScrolledThing
, wx.Notebook and the like. For that reason I don’t know if everything now works smoothly also by putting widgets directly on a frame, and sure as hell I won’t experiment it anymore
However, if there are no more problem about that, I am happy for those users who use a different coding style than mine
Hi Andrea,
I have heard a similar statement before:
quote: "Moreover, almost all the controls behave erratically when
directly placed inside a frame."
Could you elaborate on this please ?
I’m puzzle by this - I’m using wxWindows (now wxWidgets) for 5 years now
and I don’t remember any “official word” from the documentation on this !
Is this statement based on “cross platform porting experience” ?
Thanks
Sebastian Haase
Gavana, Andrea wrote:
Hello Donn,
Now, I am not exactly married to the “always stick stuff into a panel”
approach, but I was wondering what was going on here. Perhaps
I’m supposed to use sizers?
Mhm, probably “married” is a very big word , but I always found easier to
put stuff inside a wx.Panel than inside a wx.Frame.
Moreover, almost all the controls behave erratically when directly placed inside a frame.
One exception is wx.Notebook (at least on Windows), and I think also wx.ScrolledThings.
In any case, if you want to put the notebook inside the panel, I would go with sizers
with something like this:
PLATFORM:
Fedora Core 3 (Linux i686 AMD Athlon)
Python 2.3 and 2.4 depending on the Gods of the command-line.
wxPython, as reported by rpm -qa | grep wxPython
wxPython2.6-gtk2-unicode-2.6.3.2-fc2_py2.3
OUTLINE
Hello again! Colourful thread titles aside, I have a short question:
I am trying to use a notebook control for the first time.
After much head scratching and hacking, I have found that if
I put a notebook directly into a frame it will display okay,
if I put the notebook into a panel on the frame it will not.
Now, I am not exactly married to the “always stick stuff into a panel”
approach, but I was wondering what was going on here. Perhaps
I’m supposed to use sizers?
Code attached. A small change at the end can switch between
frame/panel approach to see what I mean.
This behaviour is the same under Linux and Windows XP Home
(SP2). I can’t give the Windows specs of wxPython because I’m