Agw.aui manager - set tab in dock as active?

Hello,
I have two tabs (panes) doc’d as shown in the attached python example. PlottingTop.py (3.9 KB)

I am trying to figure out how to make the panel/pane “P1” the active one so it is shown rather than “P3”. I thought the Show() method would do this but no matter what I try with Position(), Layer(), Show() and Hide() I can’t seem to get “P1” to become displayed over “P3”.

Screenshot of what I’m trying to achieve when the test app is run.

I believe you can try something like:

AuiManager.ShowPane(P1, True)
AuiManager.Update()

Otherwise you can try ActivatePane.

Hi Andrea,

ShowPane worked! Thanks for the help and thanks for creating all these widgets!

Hi Andrea,
I think part of my issue may be a misunderstanding of the pane manager such as
self._mgr = aui.AuiManager()

I have been trying to add panes on top of each other with the example I uploaded. You can see in my screenshot I have ‘tabs’ on the bottom (p1-Caption) by adding one pane on top of another.

I noticed in the wxPython demo the developers actualy created a notebook to support multiple tabs and added that to a pane. I’ve added the source for that below:
Main.py (93.8 KB)
you can see on line 1487 a notebook is created (self.nb) and on line 1610 it is added to a pane.

Should I be creating a notebook in my bottom pane this way or should I be adding panes on top of each other to create additional tabs? I ask because resizing these panes has proven to be quite difficult. The “BestSize()” call doesn’t seem to have any affect on how tall things are it just seems to apply to width.

Hi,

When possible, I strongly suggest to use AuiNotebook directly instead of using the automatic notebook facilities of AuiManager. The latter has a complex machinery inside that can be overwhelming to understand and may not do the right thing in some situations.

Of course, if you absolutely need the user to be able to float a pane and dock it into another pane to create an automatic notebook then you should rely on the heavy features. But if you create the notebook programmatically - I.e., from code - then just go with AuiNotebook itself.

Andrea.

Awesome thanks! I will go with the notebook like the wxPython and AGW examples!

Thanks so much!