auiManager ShowPane not working

Hello everyone!

I’m trying to create adjustable perspective, so I have to allow user to hide or restore panes, but I can’t get ShowPane function to do anything at all. I can close pane, but then I’m unable to restore it :frowning:

Added little example, sorry for messy layout.

auiManagerShowTest.py (2.07 KB)

Hi,

Hello everyone!

I'm trying to create adjustable perspective, so I have to allow user to hide
or restore panes, but I can't get ShowPane function to do anything at all. I
can close pane, but then I'm unable to restore it :frowning:

Added little example, sorry for messy layout.

You are missing a:

auiManager.Update()

at the end of your onButClk method.

Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 4 September 2012 13:10, jj wrote:

Missing indeed, but this doesn’t resolve the problem, atleast on my machine.

Running win8 64-bit, Python 2.7.2, wxPython 2.8.12.1

You are creating an automatic AuiNotebook when you use AddPane with
the `target` keyword; unless I am missing something, what is it that
you are trying to do? Switch pages on the notebook? Something else?

Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 4 September 2012 13:56, jj wrote:

Missing indeed, but this doesn't resolve the problem, atleast on my machine.

Running win8 64-bit, Python 2.7.2, wxPython 2.8.12.1

I want to “hide”, “close” or whatever on tab, which might be only tab or even floating window, and later I want to restore it.

In my logic auiManager.Show() should do exactly that… and when executed with False as argument it should hide window, so it can’t be seen.

···

On Tuesday, September 4, 2012 2:29:08 PM UTC+3, Infinity77 wrote:

On 4 September 2012 13:56, jj wrote:

Missing indeed, but this doesn’t resolve the problem, atleast on my machine.

Running win8 64-bit, Python 2.7.2, wxPython 2.8.12.1

You are creating an automatic AuiNotebook when you use AddPane with

the target keyword; unless I am missing something, what is it that

you are trying to do? Switch pages on the notebook? Something else?

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():

    send_message(email)

else:

    install_malware()

    erase_hard_drives()

-------------------------------------------------------------

And I mean hide as really hide, not switching to other tab, not minimizing it, really hide so user can’t restore it without using my defined way - menu item.

There is currently no way to do it for automatic notebooks. You can do
it for normal floating/docked panes, but auto-notebooks are a bit more
complicated. There might be a way to do it by tracking the pane
status, like this (just an example, not tested):

    def onButClk(self, event):
        auiManager = self.parent.auiManager
        conPane = auiManager.GetPaneByName("con1")

        if conPane and conPane.IsShown():
            conPane.Float()
            conPane.Hide()
            auiManager.DetachPane(conPane)
        else:
            auiManager.AddPane(self.secondConsole, secondConcolePane,
target = bottomPane)
            conPane.Show()

        auiManager.Update()

But nothing built-in. Patches improving AGW are most welcome, as usual.

Andrea.

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

# ------------------------------------------------------------- #
def ask_mailing_list_support(email):

    if mention_platform_and_version() and include_sample_app():
        send_message(email)
    else:
        install_malware()
        erase_hard_drives()
# ------------------------------------------------------------- #

···

On 4 September 2012 14:32, jj wrote:

I want to "hide", "close" or whatever on tab, which might be only tab or
even floating window, and later I want to restore it.

In my logic auiManager.Show() should do exactly that... and when executed
with False as argument it should hide window, so it can't be seen.

a bit funny, I finded this solution about 30 min after posting this thread, now the problem is, that if in target = bottomPane, bottomPane doesn’t contain any window it get’s ignored and new pane, I guess, defaults to wx.LEFT, haven’t found workaround for this one yet. cu’s bottomPane.IsShown() and bottomPane.IsOk() returns True, even if this pane is empty and take’s no space on screen.

I guess I could catch this situation by checking each pane’s location and if no one is in bottomPane, then try to create new one and destroy old one, but this really not “The right way” to do things :frowning:

It might be possible, that I’ve constructed this whole frame thing a bit wrong. Can I add empty pane, which is usable only as target and it isn’t main pane for any windows? Cus until now I can’t find how to do that, but if I could, this would resolve my problems, I think.

Thanks for replay’s Andrea.

···

On Tuesday, September 4, 2012 2:47:44 PM UTC+3, Infinity77 wrote:

On 4 September 2012 14:32, jj wrote:

I want to “hide”, “close” or whatever on tab, which might be only tab or

even floating window, and later I want to restore it.

In my logic auiManager.Show() should do exactly that… and when executed

with False as argument it should hide window, so it can’t be seen.

There is currently no way to do it for automatic notebooks. You can do

it for normal floating/docked panes, but auto-notebooks are a bit more

complicated. There might be a way to do it by tracking the pane

status, like this (just an example, not tested):

def onButClk(self, event):

    auiManager = self.parent.auiManager

    conPane = auiManager.GetPaneByName("con1")



    if conPane and conPane.IsShown():

        conPane.Float()

        conPane.Hide()

        auiManager.DetachPane(conPane)

    else:

        auiManager.AddPane(self.secondConsole, secondConcolePane,

target = bottomPane)

        conPane.Show()



    auiManager.Update()

But nothing built-in. Patches improving AGW are most welcome, as usual.

Andrea.

“Imagination Is The Only Weapon In The War Against Reality.”

http://xoomer.alice.it/infinity77/

-------------------------------------------------------------

def ask_mailing_list_support(email):

if mention_platform_and_version() and include_sample_app():

    send_message(email)

else:

    install_malware()

    erase_hard_drives()

-------------------------------------------------------------