XRC and two stage creation in Phoenix

90 views
Skip to first unread message

André Colomb

unread,
Feb 1, 2018, 4:43:58 AM2/1/18
to wxPython-users
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

André Colomb

unread,
Feb 2, 2018, 11:06:07 AM2/2/18
to wxPython-users
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 https://docs.wxpython.org/MigrationGuide.html#phase-create, 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é

André Colomb

unread,
Feb 5, 2018, 3:43:52 AM2/5/18
to wxPython-users
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.

Pull Request created at https://github.com/wxWidgets/Phoenix/pull/726.

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é
Reply all
Reply to author
Forward
0 new messages