Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wxGUI/gmodeler: fix setToolBar failing on macOS #5298

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gui/wxpython/gmodeler/toolbars.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,15 @@ class ModelerToolbar(BaseToolbar):
def __init__(self, parent):
BaseToolbar.__init__(self, parent)

# realize the toolbar
self.Realize()

# workaround for http://trac.wxwidgets.org/ticket/13888
if sys.platform == "darwin":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This workaround, is what causes the problem. It is apparently not needed anymore, can't tell since when...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is the workaround in our code: if sys.platform == "darwin": ...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nilason: Shall we fully remove the snippet then?

       # workaround for http://trac.wxwidgets.org/ticket/13888
        if sys.platform == "darwin":
            parent.SetToolBar(self)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if sys.platform == "darwin" and not CheckWxVersion([4, 2, 1]): seems to work for me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nilason: What about if sys.platform == "darwin" and not CheckWxVersion([4, 2, 0]):? If the 4.2 version of wx brought the incosistency to macOS, it was probably already in the 4.2.0 version.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about if sys.platform == "darwin" and not CheckWxVersion([4, 2, 0]):?

I could test only with 4.2.1 and 4.2.2.

If the 4.2 version of wx brought the incosistency to macOS, it was probably already in the 4.2.0 version.

Let us go safe and fix what has been tested. If someone, however unlikely, will attempt to run with 4.2.0 and report then I'd say we're happy to address it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in your proposed way in 289dd1c

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will need to add something like from core.globalvar import CheckWxVersion.

parent.SetToolBar(self)

self.InitToolbar(self._toolbarData())

# realize the toolbar
self.Realize()

def _toolbarData(self):
"""Toolbar data"""
icons = {
Expand Down
Loading