-
Notifications
You must be signed in to change notification settings - Fork 30
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
Improvements to wx and qt #141
Conversation
if parent is None: | ||
return wx.Frame.__new__(WxWgpuFrame, *args, **kwargs) | ||
else: | ||
return wx.Window.__new__(WxWgpuWindow, *args, **kwargs) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this dynamic inheritance? First time I ever see that implemented like this :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure what it's called TBH. It creates an instance of a subclass, and the subclass depends on the input. Not entirely happy about this, see #142
Do you mean this PR breaks the integration? |
No, it did not work to start with. (I just double-checked) |
OK, then we can merge. ;) |
One of the problems I had mentioned (I was going to add a code comment about it, but decided not to): the Wgpu async
That wouldn't work for a widget, obviously. |
That should work now, I think, because both the widget and the frame implement the WgpuCanvas interface. But also see #142 |
wxpython.py
->wx.py
(but the changes that followed make git forget it's the same file)wx.WgpuCanvas
and it will work as a main frame or embedded widget.get_physical_size
for pyqt6.I also implemented
request_draw()
but it draws directly. This should be changed so the actual draw happens later, preferably rate-limited. I wanted to look into that, but for some reason I get a context lost when I try to run pygfx with a wx widget, so I'll leave this for another day/person.