-
-
Notifications
You must be signed in to change notification settings - Fork 344
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
base: main
Are you sure you want to change the base?
wxGUI/gmodeler: fix setToolBar failing on macOS #5298
Conversation
gui/wxpython/gmodeler/toolbars.py
Outdated
@@ -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": |
There was a problem hiding this comment.
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...
There was a problem hiding this comment.
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": ...
There was a problem hiding this comment.
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)
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
tested and proposed by @nilason
The bug seems to be in wxpython: wxWidgets/wxWidgets#24560
One of the workarounds mentioned in the linked issue is to call
Realize()
beforesetToolBar()
- this is an attempt to fix it with this trick