Skip to content

Commit ee30b5d

Browse files
committed
comments
1 parent 6b96641 commit ee30b5d

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

rendercanvas/glfw.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,8 @@ class GlfwRenderCanvas(BaseRenderCanvas):
147147
# See https://www.glfw.org/docs/latest/group__window.html
148148

149149
def __init__(self, *args, present_method=None, **kwargs):
150-
super().__init__(*args, **kwargs)
151-
152150
loop.init_glfw()
151+
super().__init__(*args, **kwargs)
153152

154153
if present_method == "image":
155154
logger.warning(

rendercanvas/qt.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -472,9 +472,10 @@ class QRenderCanvas(WrapperRenderCanvas, QtWidgets.QWidget):
472472
# detect this. See https://github.com/pygfx/wgpu-py/pull/68
473473

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

480481
self._subwidget = QRenderWidget(self, **kwargs)

rendercanvas/wx.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -429,11 +429,16 @@ class WxRenderCanvas(WrapperRenderCanvas, wx.Frame):
429429
# Most of this is proxying stuff to the inner widget.
430430

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

435438
self._subwidget = WxRenderWidget(parent=self, **kwargs)
439+
436440
self.Bind(wx.EVT_CLOSE, lambda e: self.Destroy())
441+
437442
self.Show()
438443
self._final_canvas_init()
439444

0 commit comments

Comments
 (0)