Hi again!
With a now functional wxPython 4.0.0(rc1) build on Ubuntu 17.10, I tried Phoenix-migrating my XRC-related code.
Starting from the code generated by pywxrc, I tried to implement the following parts of the migration guide:
https://docs.wxpython.org/MigrationGuide.html#overloaded-functions
https://docs.wxpython.org/MigrationGuide.html#phase-create
https://docs.wxpython.org/MigrationGuide.html#xrc
With the modified code (attached), the window is shown and basically works. However, there are lots of “GDK_IS_WINDOW (window)” assertion failures and “ScreenToClient cannot work when toplevel window is not shown” messages on the console. Seems like there is a stray top-level window somewhere, and the one showing is not properly initialized?
What other changes are needed to make this XRC example work in Phoenix?
Will pywxrc be updated to generate Phoenix-compatible wrapper code?
Thanks in advance!
André
pywxrc_demo_xrc-phoenix.py (1.29 KB)
Replying to myself with new insights…
···
On Thursday, February 1, 2018 at 10:43:58 AM UTC+1, André Colomb wrote:
With the modified code (attached), the window is shown and basically works. However, there are lots of “GDK_IS_WINDOW (window)” assertion failures and “ScreenToClient cannot work when toplevel window is not shown” messages on the console. Seems like there is a stray top-level window somewhere, and the one showing is not properly initialized?
The extra top-level window was probably caused by calling wx.Frame.Create()
in the constructor. Removing that call got rid of the console error messages.
I got the idea that Create() is needed from wxPython Project Phoenix Migration Guide — wxPython Phoenix 4.2.2 documentation, but XmlResource.LoadFrame() already does what’s necessary.
So these changes just need to be ported to pywxrc. I’ll try to open a PR for that.
Kind regards
André
Pull Request created at Phoenix compatibility in pywxrc by acolomb · Pull Request #726 · wxWidgets/Phoenix · GitHub.
I’m still very new to everything wx, so I can’t really judge what other modifications are needed for Phoenix compatibility in all of pywxrc’s features. But better fix a few problems than none
Regards
André
···
On Friday, February 2, 2018 at 5:06:07 PM UTC+1, André Colomb wrote:
So these changes just need to be ported to pywxrc. I’ll try to open a PR for that.