Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
almarklein committed Nov 8, 2024
1 parent 6b96641 commit ee30b5d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 1 addition & 2 deletions rendercanvas/glfw.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,9 +147,8 @@ class GlfwRenderCanvas(BaseRenderCanvas):
# See https://www.glfw.org/docs/latest/group__window.html

def __init__(self, *args, present_method=None, **kwargs):
super().__init__(*args, **kwargs)

loop.init_glfw()
super().__init__(*args, **kwargs)

if present_method == "image":
logger.warning(
Expand Down
5 changes: 3 additions & 2 deletions rendercanvas/qt.py
Original file line number Diff line number Diff line change
Expand Up @@ -472,9 +472,10 @@ class QRenderCanvas(WrapperRenderCanvas, QtWidgets.QWidget):
# detect this. See https://github.com/pygfx/wgpu-py/pull/68

def __init__(self, parent=None, **kwargs):
# When using Qt, there needs to be an
# application before any widget is created
# There needs to be an application before any widget is created.
loop.init_qt()
# Any kwargs that we want to pass to *this* class, must be explicitly
# specified in the signature. The rest goes to the subwidget.
super().__init__(parent)

self._subwidget = QRenderWidget(self, **kwargs)
Expand Down
5 changes: 5 additions & 0 deletions rendercanvas/wx.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,11 +429,16 @@ class WxRenderCanvas(WrapperRenderCanvas, wx.Frame):
# Most of this is proxying stuff to the inner widget.

def __init__(self, parent=None, **kwargs):
# There needs to be an application before any widget is created.
loop.init_wx()
# Any kwargs that we want to pass to *this* class, must be explicitly
# specified in the signature. The rest goes to the subwidget.
super().__init__(parent)

self._subwidget = WxRenderWidget(parent=self, **kwargs)

self.Bind(wx.EVT_CLOSE, lambda e: self.Destroy())

self.Show()
self._final_canvas_init()

Expand Down

0 comments on commit ee30b5d

Please sign in to comment.