XRC and two stage creation in Phoenix

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

XRC and two stage creation in Phoenix

André Colomb
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é

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.

pywxrc_demo_xrc-phoenix.py (1K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: XRC and two stage creation in Phoenix

André Colomb
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é

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|

Re: XRC and two stage creation in Phoenix

André Colomb
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é

--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
For more options, visit https://groups.google.com/d/optout.