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
How to set wx.App() from C++? #1126
Comments
The C++ Currently that class isn't accessible from outside via the API, not sure it makes sense to do so but I'll give it some thought. Or perhaps just have |
Gentle ping on this issue. |
This issue has been mentioned on Discuss wxPython. There might be relevant details there: https://discuss.wxpython.org/t/wxpython-4-1-0-released/34564/1 |
Operating system: Arch Linux
wxPython version & source: '4.0.3 gtk3 (phoenix) wxWidgets 3.0.4'
Python version & source: 3.7.2
Description of the problem:
I did the Python3/Phoenix Port of KiCad some time ago. Unfortunately, it seems like the application is not exiting correctly when the scripting console (based on wx) was used: https://bugs.launchpad.net/kicad/+bug/1809913
I assume it is due to a hack needed to get phoenix working which required me to to create a new
wx.App()
inside python, and not to reuse the main one of the c++ application itself. Removing it cause the error:assert app is not None, 'No wx.App created yet'
because ofwx.GetApp()
returns None. How do I correctly instantiate a wx.Phoenix frame using the c++ app?My patchset to get Phoenix working can be found here:
KiCad/kicad-source-mirror@0e0b4d5
Notable is the change to instantiate a new wx.App():
KiCad/kicad-source-mirror@0e0b4d5#diff-51d04e3e5130cdd6081b1702c5e35827R92
As well as the change to actually create the window. In the old implementation, we used the wxWindow parent of the c++ application, while in the new implementation the window id is used.
KiCad/kicad-source-mirror@0e0b4d5#diff-b4427d47c8cfee59a51819e36acbdd4aL383
It would be nice to know how to correctly create wx Phoenix frames from c++ or what issues I created in this implementation.
The text was updated successfully, but these errors were encountered: