Skip to content

Warn for inproper use of WxRenderWidget #92

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Warn for inproper use of WxRenderWidget #92

wants to merge 2 commits into from

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented May 22, 2025

Closes #91 cc @tlambert03

@tlambert03
Copy link
Contributor

tlambert03 commented May 22, 2025

This is fine, however, there’s shouldn’t be technically anything wrong with creating an unparented widget and then reparenting it before starting the event loop right?

Thats what I had been doing and why this warning sorta misses the point (which is more that rendercanvas doesn’t support that mode of operation… even if you didn’t intend to use it as a top widget)

the key reason that that is an unsupported mode is because of operations performed by renderwidget in the init (not because of a problem with an temporarily unparented widget in wxpython). So the warning should perhaps say “render widget requires a parent at the time of instantiation” rather than assuming it was going to be a top level widget

@Vipitis
Copy link
Contributor

Vipitis commented May 22, 2025

I think the same is also true for QRenderWidget I had imported that instead of RenderCanvas and I had to kill the terminal to recover.

@almarklein
Copy link
Member Author

there’s shouldn’t be technically anything wrong with creating an unparented widget and then reparenting it before starting the event loop right?

Good point! I tweaked the code so that it allows a (temporary) unparented widget. Could you try and see if it works with what you were trying?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WxRenderWidget cannot be used on its own (segfault)
3 participants