Can't get a caption on agw.aui CenterPane?

Hi,

I switched to the latest version of agw.aui from Subversion , but I
can't get a caption on my CenterPane. This is how I'm adding panes:

    def AddPage(self, page, caption, name):
        paneInfo =
aui.AuiPaneInfo().Name(name).Caption(caption).Left().MaximizeButton().DestroyOnClose().FloatingSize((300,200))
        # To ensure we have a center pane we make the first pane the
center pane:
        if not self.manager.GetAllPanes():
            paneInfo = paneInfo.CenterPane().CloseButton(False)
        self.manager.AddPane(page, paneInfo)
        self.manager.Update()

All panes have captions except the CenterPane...

Thanks, Frank

Hi Frank,

2009/10/9 Frank Niessink:

Hi,

I switched to the latest version of agw.aui from Subversion , but I
can't get a caption on my CenterPane. This is how I'm adding panes:

def AddPage(self, page, caption, name):
paneInfo =
aui.AuiPaneInfo().Name(name).Caption(caption).Left().MaximizeButton().DestroyOnClose().FloatingSize((300,200))
# To ensure we have a center pane we make the first pane the
center pane:
if not self.manager.GetAllPanes():
paneInfo = paneInfo.CenterPane().CloseButton(False)
self.manager.AddPane(page, paneInfo)
self.manager.Update()

All panes have captions except the CenterPane...

This issue (together with the other in the previous message regarding
CenterPane) is due to the fact that the call to CenterPane() restore
the pane state to zero, actually clearing all your previous calls to
Caption(), DestroyOnClose() and so on.

I am not sure which is the best way to go: I could simply remove the
line which resets the pane state in CenterPane(), but this will then
probably break other applications that dynamically change the
CenterPane. This problem has never appeared before because normally
one knows a priori which is the center pane: for example, what I
usually do is:

pane = aui.AuiPaneInfo().Name(name).CenterPane()
self.manager.AddPane(window, paneInfo)

for window in allOtherWindows:
    pane = aui.AuiPaneInfo().Name(name).Left().Caption(caption) # Or
Right(), or Top() etc...
    self.manager.AddPane(window, paneInfo)

Is there any suggestion on how we should handle the resetting of the
pane state? Michael, Werner, Frank?

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

Andrea,

Andrea Gavana wrote:

Hi Frank,

2009/10/9 Frank Niessink:
  

Hi,

I switched to the latest version of agw.aui from Subversion , but I
can't get a caption on my CenterPane. This is how I'm adding panes:

   def AddPage(self, page, caption, name):
       paneInfo =
aui.AuiPaneInfo().Name(name).Caption(caption).Left().MaximizeButton().DestroyOnClose().FloatingSize((300,200))
       # To ensure we have a center pane we make the first pane the
center pane:
       if not self.manager.GetAllPanes():
           paneInfo = paneInfo.CenterPane().CloseButton(False)
       self.manager.AddPane(page, paneInfo)
       self.manager.Update()

All panes have captions except the CenterPane...
    
This issue (together with the other in the previous message regarding
CenterPane) is due to the fact that the call to CenterPane() restore
the pane state to zero, actually clearing all your previous calls to
Caption(), DestroyOnClose() and so on.

I am not sure which is the best way to go: I could simply remove the
line which resets the pane state in CenterPane(), but this will then
probably break other applications that dynamically change the
CenterPane. This problem has never appeared before because normally
one knows a priori which is the center pane: for example, what I
usually do is:

pane = aui.AuiPaneInfo().Name(name).CenterPane()
self.manager.AddPane(window, paneInfo)

for window in allOtherWindows:
    pane = aui.AuiPaneInfo().Name(name).Left().Caption(caption) # Or
Right(), or Top() etc...
    self.manager.AddPane(window, paneInfo)

Is there any suggestion on how we should handle the resetting of the
pane state? Michael, Werner, Frank?
  

I don't change the CenterPane after creation, at least I have not had the need for this - yet.

Frank, would it be any problem for you to change your code a bit a round, i.e. check first if this page should become the centerpane and then do whatever is needed. In other words have an if/else block with two different "paneInfo" settings.

Werner

I decided to do without a CenterPane at all and fake one because I
couldn't get a CenterPane with a Caption. So now I'm doing it like
this:

    def AddPage(self, page, caption, name):
        paneInfo =
aui.AuiPaneInfo().Name(name).Caption(caption).Left().MaximizeButton().DestroyOnClose().FloatingSize((300,200))
        # To ensure we have a center pane we make the first pane the
center pane:
        if not self.manager.GetAllPanes():
            paneInfo = paneInfo.Center().CloseButton(False).Floatable(False)
        self.manager.AddPane(page, paneInfo)
        self.manager.Update()

This seems to work fine.

Thanks, Frank

···

2009/10/10 werner <wbruhin@free.fr>:

Frank, would it be any problem for you to change your code a bit a
round, i.e. check first if this page should become the centerpane and
then do whatever is needed. In other words have an if/else block with
two different "paneInfo" settings.

Frank,
Use .CaptionVisible() on your .CenterPane() and it will show the
caption... (like Andrea said, make sure it comes after the .CenterPane
())

There's nothing different about the CenterPane() and just calling a
bunch of the right .Attributes() on your pane, so what you are doing
should work fine, it might even be what you prefer because CenterPanes
aren't notebook-dockable and it seems like you want that from your
other post...

When is your center pane not the same pane? Is this by a user's
preference? It seems like maybe there is an easier way to do these
different layouts with perspectives, but I don't have a full picture
of what you are doing in regard to your layout..

- michael

···

On Oct 10, 7:00 am, Frank Niessink <fr...@niessink.com> wrote:

2009/10/10 werner <wbru...@free.fr>:

> Frank, would it be any problem for you to change your code a bit a
> round, i.e. check first if this page should become the centerpane and
> then do whatever is needed. In other words have an if/else block with
> two different "paneInfo" settings.

I decided to do without a CenterPane at all and fake one because I
couldn't get a CenterPane with a Caption. So now I'm doing it like
this:

def AddPage\(self, page, caption, name\):
    paneInfo =

aui.AuiPaneInfo().Name(name).Caption(caption).Left().MaximizeButton().DestroyOnClose().FloatingSize((300,200))
# To ensure we have a center pane we make the first pane the
center pane:
if not self.manager.GetAllPanes():
paneInfo = paneInfo.Center().CloseButton(False).Floatable(False)
self.manager.AddPane(page, paneInfo)
self.manager.Update()

This seems to work fine.

Thanks, Frank

Hi Frank,

2009/10/10 Frank Niessink:

Frank, would it be any problem for you to change your code a bit a
round, i.e. check first if this page should become the centerpane and
then do whatever is needed. In other words have an if/else block with
two different "paneInfo" settings.

I decided to do without a CenterPane at all and fake one because I
couldn't get a CenterPane with a Caption.

You can have a CenterPane with caption, as Michael said: use
CaptionVisible on all your panes and you'll get what you need.

Andrea.

"Imagination Is The Only Weapon In The War Against Reality."
http://xoomer.alice.it/infinity77/

···

2009/10/10 werner <wbruhin@free.fr>:

There's nothing different about the CenterPane() and just calling a
bunch of the right .Attributes() on your pane, so what you are doing
should work fine, it might even be what you prefer because CenterPanes
aren't notebook-dockable and it seems like you want that from your
other post...

Yep, that's what I ended up doing and it seems to work fine so far.

When is your center pane not the same pane? Is this by a user's
preference? It seems like maybe there is an easier way to do these
different layouts with perspectives, but I don't have a full picture
of what you are doing in regard to your layout..

The center pane is always the same viewer. I think I did it this way
to make to make the code that adds viewers on application startup
simpler.

Thanks, Frank

···

2009/10/10 michael h <michaelkenth@gmail.com>:

Thanks, as said elsewhere I ended up using a slightly different solution.

Cheers, Frank

PS: Is there documentation somewhere on the web for agw.aui? Or should
I just use the sources :slight_smile:

···

2009/10/10 Andrea Gavana <andrea.gavana@gmail.com>:

You can have a CenterPane with caption, as Michael said: use
CaptionVisible on all your panes and you'll get what you need.