Tom, just taking a very quick go with it, if you comment out both the
.Fit() lines
in Main, it lays out fine. But I couldn’t get
self.notebook.SetSelection(newPanel)
to work for some reason, which you might want (to show the new plugin popping
up as the selected tab)–is this because your notebook is sitting
directly on the
frame? (often considered not a good idea, though I thought with a notebook it
wouldn’t matter?).
btw, for your About, did you know there is a wx.AboutBox? See the demo.
Che
Che,
If I remove the Fit() lines, the windows doesn’t actually layout the way I want.
Actually I call Fit() in order to size the window according to the panel(s) that I attached to the Notebook. That is, I expect the frame to fit the biggest panel I attach to the notebook.
I’m not sure why Fit() doesn’t size the frame properly according to its children in this case.
When I use the wx.Notebook class instead of wx.AuiNotebook the sizing works as expected.
Note: the self.notebook.SetSelection(arg) expects an index as the argument. I checked and that seems to work fine.
Yes, I had a chance to try that in your code and see that. Weird. Does
suggest it is something with wx.AUINotebook... Not sure what the issue is.
Maybe someone else can suggest something, or you could try Andrea's
version of AUI?
Che
···
On Tue, May 5, 2009 at 10:34 AM, Tom Clerckx <tclerckx@gmail.com> wrote:
Tom, just taking a very quick go with it, if you comment out both the
.Fit() lines
in Main, it lays out fine. But I couldn't get
self.notebook.SetSelection(newPanel)
to work for some reason, which you might want (to show the new plugin
popping
up as the selected tab)--is this because your notebook is sitting
directly on the
frame? (often considered not a good idea, though I thought with a notebook
it
wouldn't matter?).
btw, for your About, did you know there is a wx.AboutBox? See the demo.
Che
Che,
If I remove the Fit() lines, the windows doesn't actually layout the way I
want.
Actually I call Fit() in order to size the window according to the panel(s)
that I attached to the Notebook. That is, I expect the frame to fit the
biggest panel I attach to the notebook.
I'm not sure why Fit() doesn't size the frame properly according to its
children in this case.
When I use the wx.Notebook class instead of wx.AuiNotebook the sizing works
as expected.
> Tom, just taking a very quick go with it, if you comment out both the
> .Fit() lines
> in Main, it lays out fine. But I couldn't get
> self.notebook.SetSelection(newPanel)
> to work for some reason, which you might want (to show the new plugin popping
> up as the selected tab)--is this because your notebook is sitting
> directly on the
> frame? (often considered not a good idea, though I thought with a notebook it
> wouldn't matter?).
>
> btw, for your About, did you know there is a wx.AboutBox? See the demo.
>
> Che
If I remove the Fit() lines, the windows doesn't actually layout the way I want.
Actually I call Fit() in order to size the window according to the panel(s) that I attached to the Notebook. That is, I expect the frame to fit the biggest panel I attach to the notebook.
I'm not sure why Fit() doesn't size the frame properly according to its children in this case.
When I use the wx.Notebook class instead of wx.AuiNotebook the sizing works as expected.
Note: the self.notebook.SetSelection(arg) expects an index as the argument. I checked and that seems to work fine.
Best regards,
Tom.
Not sure if this will help you, but for me, Fit() usually doesn't do what I expect intuitively. What seems to work better is using the "best size" rather than the "minimum size", by doing something along the lines of
self.SetSize(self.GetBestSize())
or if you have a panel as the only child of a frame, something like