Skip to content

Compatibility with wxWidgets 3.0 #96

Closed
mojca opened this Issue Dec 25, 2013 · 7 comments

4 participants

@mojca
mojca commented Dec 25, 2013

I would like to request patching the software to make it compatible with wxWidgets/wxPython 3.0.

(Supporting wxPython 2.8 in MacPorts is a pain since Mac OS X stopped shipping Carbon headers in 10.6.)

@corranwebster
Enthought, Inc. member

@mojca What issues are you experiencing with wxWidgets 3.0 specifically? If you have patches to contribute, there is a reasonable chance that they will be accepted if you make a pull request.

@mojca
mojca commented Jan 5, 2014

I'm only maintaining wxPython packages in MacPorts and would like to "get rid of" all packages claiming dependency on wxPython 2.8. Honestly I'm not even sure how to run pyface let alone write any patch for it.

The maintainer of pyface in MacPorts wouldn't let me switch the port to wxPython 3.0 claiming that Qt is now considered superior and that last time he tried using pyface with wxWidgets 2.9 it didn't work.

Here's one of the ticket in MacPorts: https://trac.macports.org/ticket/40207.
I also saw enthought/traitsui#106 among others.

Since I'm not a regular user, it's hard for me to tell what exactly isn't working, but I can ask the maintainer of the port to report what exactly went wrong for him. I only wanted to express my interest in having at least somewhat functional support for wxPython 3.0 in pyface, so that we could switch the dependency in MacPorts from wxPython 2.8 to 3.0. If or as soon as you believe that we could use wxPython 3.0, we'll switch to that.

(In most cases wxWidgets 3.0 doesn't work out-of-the-box until developers do at least a bunch of modifications to make their software compatible. Maybe you already tested and fixed some problems recently, I didn't try to closely follow the development.)

I'll ask the maintainer of the package to explain what problems he has exactly.

@jjstickel

I tested pyface with wx-3.0 via mayavi. I made sure to move pyqt4 libs out of the way (port deactivate ...). Things are unstable, and I quickly lose mouse control in the main window, although the menu bar still works and I can quit cleanly. Here are the messages I see in the terminal window:

$ mayavi2-2.7
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyface/ui/wx/init.py:25: wxPyDeprecationWarning: Using deprecated class PySimpleApp.
  _app = wx.PySimpleApp()
/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyface/ui/wx/init.py:29: wxPyDeprecationWarning: Call to deprecated item 'InitAllImageHandlers'.
  wx.InitAllImageHandlers()
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyface/ui/wx/splash_screen.py", line 121, in _on_paint
    dc = wx.PaintDC(window)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_gdi.py", line 5122, in __init__
    _gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at ../src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyface/ui/wx/splash_screen.py", line 121, in _on_paint
    dc = wx.PaintDC(window)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_gdi.py", line 5122, in __init__
    _gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at ../src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyface/ui/wx/splash_screen.py", line 121, in _on_paint
    dc = wx.PaintDC(window)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_gdi.py", line 5122, in __init__
    _gdi_.PaintDC_swiginit(self,_gdi_.new_PaintDC(*args, **kwargs))
wx._core.PyAssertionError: C++ assertion "window->MacGetCGContextRef() != NULL" failed at ../src/osx/carbon/dcclient.cpp(195) in wxPaintDCImpl(): using wxPaintDC without being in a native paint event
2014-01-08 09:30:35.179 Python[12630:707] *** WARNING: Method userSpaceScaleFactor in class NSView is deprecated on 10.7 and later. It should not be used in new applications. Use convertRectToBacking: instead.
Exception occurred in traits notification handler for object: <mayavi.plugins.envisage_engine.EnvisageEngine object at 0x10f40a170>, trait: _current_selection, old value: None, new value: <mayavi.core.adder_node.SourceAdderNode object at 0x11195d950>
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traits/trait_notifiers.py", line 520, in _dispatch_change_event
    self.dispatch( handler, *args )
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traits/trait_notifiers.py", line 615, in dispatch
    handler( *args )
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/editor.py", line 366, in _update_editor
    self.update_editor()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/wx/instance_editor.py", line 373, in update_editor
    self.resynch_editor()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/wx/instance_editor.py", line 411, in resynch_editor
    panel.DestroyChildren()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py", line 9194, in DestroyChildren
    return _core_.Window_DestroyChildren(*args, **kwargs)
PyAssertionError: C++ assertion "GetEventHandler() == this" failed at ../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have been removed
ERROR|2014-01-08 09:30:36,917|Exception occurred in traits notification handler for object: <mayavi.plugins.envisage_engine.EnvisageEngine object at 0x10f40a170>, trait: _current_selection, old value: None, new value: <mayavi.core.adder_node.SourceAdderNode object at 0x11195d950>
Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traits/trait_notifiers.py", line 520, in _dispatch_change_event
    self.dispatch( handler, *args )
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traits/trait_notifiers.py", line 615, in dispatch
    handler( *args )
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/editor.py", line 366, in _update_editor
    self.update_editor()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/wx/instance_editor.py", line 373, in update_editor
    self.resynch_editor()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/traitsui/wx/instance_editor.py", line 411, in resynch_editor
    panel.DestroyChildren()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/wx-3.0-osx_cocoa/wx/_core.py", line 9194, in DestroyChildren
    return _core_.Window_DestroyChildren(*args, **kwargs)
PyAssertionError: C++ assertion "GetEventHandler() == this" failed at ../src/common/wincmn.cpp(478) in ~wxWindowBase(): any pushed event handlers must have been removed
../src/common/module.cpp(194): assert "module->m_state == State_Initialized" failed in DoCleanUpModules(): not initialized module being cleaned up
@jjstickel

Another problem is that there does not seem to be a way to force either qt4 or wx when both libraries are installed. If both are found, wx is used (and broken, as per above). Is this a known issue?

@pberkes
Enthought, Inc. member
@corranwebster
Enthought, Inc. member

@mojca Experimental support for wxWidgets 3 is now in master and should be in the next release thanks to @RobinD42. Unfortunately this can't be easily tested using continuous integration at the present, so there may well be bugs.

I'm going to close this issue. Please report any problems you find running under wxPython 3 as separate issues.

@mojca
mojca commented Sep 26, 2015

Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.