Can't remove gripper from AuiToolBar (wx.lib.agw.aui)

Hi everyone.

I’m a long(-ish) time user of wxPython, but new to the list. So I’d like to start by thanking all the people making wxPython possible!

I have encountered a problem when trying to hide the gripper on a AuiToolBar using the agw implementation of aui. When adding the toolbar to the manager I give the property Gripper(False), however, if I save that perspective and then load it again the gripper comes back.

I have attached a small example script replicating the problem. When I run this script the toolbar has a gripper. If I change line 49 from “if True:” to “if False:” (so that the perspective is never loaded) the gripper disappears. If I use the wx.aui implementation for the AuiManager and AuiPaneInfo (but still agw for the toolbar) the gripper is behaving as expected (=no gripper, even when loading the perspective).

I’m using wxPython 2.8.12.1 and Python 2.7.6 under Debian.

Regards
Daniel

aui_toolbar_test.py (2.5 KB)

Andrea will have to answer this for sure, but it looks like the gripper is intended to be restored in LoadPerspective if either floatable or dockable is set. So, first you’d have to add Dockable(False) to your program, but I’m not sure that’s what you intend.

There’s a line in LoadPerspective:

        if isinstance(pane.window, auibar.AuiToolBar) and (pane.IsFloatable() or pane.IsDockable()):
            pane.window.SetGripperVisible(True)

but the check in AuiPaneInfo.IsDockable includes a check on IsNotebookDockable, but the setter (AuiPaneInfo.Dockable) doesn’t include NotebookDockable. I’m not sure if it should assign a value to NotebookDockable in all cases.

If I do make that assumption and change it, your test program works.

I’m not sure if it’s valid to do that in all cases, though… Hopefully Andrea will have some time to look at it.

Rob

···

On Tue, Feb 4, 2014 at 6:52 AM, daniel.forchheimer@gmail.com wrote:

Hi everyone.

I’m a long(-ish) time user of wxPython, but new to the list. So I’d like to start by thanking all the people making wxPython possible!

I have encountered a problem when trying to hide the gripper on a AuiToolBar using the agw implementation of aui. When adding the toolbar to the manager I give the property Gripper(False), however, if I save that perspective and then load it again the gripper comes back.

I have attached a small example script replicating the problem. When I run this script the toolbar has a gripper. If I change line 49 from “if True:” to “if False:” (so that the perspective is never loaded) the gripper disappears. If I use the wx.aui implementation for the AuiManager and AuiPaneInfo (but still agw for the toolbar) the gripper is behaving as expected (=no gripper, even when loading the perspective).

I’m using wxPython 2.8.12.1 and Python 2.7.6 under Debian.

Regards
Daniel

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.

Hi Rob.

Thanks for having a look in the code and explaining the behavior. My intention was to have a toolbar which was always “docked” in the same position. That it, always positioned at the left hand side of the screen with no possibility for the user to move it. Thus setting Dockable(False) did not occur to me as the logical option. What is a window that is neither docked, nor floating?

However, setting Dockable(False) and also NotebookDockable(False) completely fixes my problem! So I’m happy with that solution :slight_smile:

/Daniel

···

On Wednesday, February 5, 2014 12:21:24 AM UTC+1, Rob McMullen wrote:

Andrea will have to answer this for sure, but it looks like the gripper is intended to be restored in LoadPerspective if either floatable or dockable is set. So, first you’d have to add Dockable(False) to your program, but I’m not sure that’s what you intend.

There’s a line in LoadPerspective:

        if isinstance(pane.window, auibar.AuiToolBar) and (pane.IsFloatable() or pane.IsDockable()):
            pane.window.SetGripperVisible(True)

but the check in AuiPaneInfo.IsDockable includes a check on IsNotebookDockable, but the setter (AuiPaneInfo.Dockable) doesn’t include NotebookDockable. I’m not sure if it should assign a value to NotebookDockable in all cases.

If I do make that assumption and change it, your test program works.

I’m not sure if it’s valid to do that in all cases, though… Hopefully Andrea will have some time to look at it.

Rob

On Tue, Feb 4, 2014 at 6:52 AM, daniel.fo...@gmail.com wrote:

Hi everyone.

I’m a long(-ish) time user of wxPython, but new to the list. So I’d like to start by thanking all the people making wxPython possible!

I have encountered a problem when trying to hide the gripper on a AuiToolBar using the agw implementation of aui. When adding the toolbar to the manager I give the property Gripper(False), however, if I save that perspective and then load it again the gripper comes back.

I have attached a small example script replicating the problem. When I run this script the toolbar has a gripper. If I change line 49 from “if True:” to “if False:” (so that the perspective is never loaded) the gripper disappears. If I use the wx.aui implementation for the AuiManager and AuiPaneInfo (but still agw for the toolbar) the gripper is behaving as expected (=no gripper, even when loading the perspective).

I’m using wxPython 2.8.12.1 and Python 2.7.6 under Debian.

Regards
Daniel

You received this message because you are subscribed to the Google Groups “wxPython-users” group.

To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.

For more options, visit https://groups.google.com/groups/opt_out.