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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion rendercanvas/wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -355,8 +355,13 @@ def _rc_set_logical_size(self, width, height):
parent = self.Parent
if isinstance(parent, WxRenderCanvas):
parent.SetSize(width, height)
else:
elif parent is not None:
self.SetSize(width, height)
else:
# The widget has no parent, likely because its going to inserted in a GUI later.
# This method is likely called from _final_canvas_init and if we call self.SetSize() it will likely error/segfault.
# See https://github.com/pygfx/rendercanvas/issues/91
pass

def _rc_close(self):
self._is_closed = True
Expand Down