File tree Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Expand file tree Collapse file tree 3 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,8 @@ class GlfwRenderCanvas(BaseRenderCanvas):
147
147
# See https://www.glfw.org/docs/latest/group__window.html
148
148
149
149
def __init__ (self , * args , present_method = None , ** kwargs ):
150
- super ().__init__ (* args , ** kwargs )
151
-
152
150
loop .init_glfw ()
151
+ super ().__init__ (* args , ** kwargs )
153
152
154
153
if present_method == "image" :
155
154
logger .warning (
Original file line number Diff line number Diff line change @@ -472,9 +472,10 @@ class QRenderCanvas(WrapperRenderCanvas, QtWidgets.QWidget):
472
472
# detect this. See https://github.com/pygfx/wgpu-py/pull/68
473
473
474
474
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.
477
476
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.
478
479
super ().__init__ (parent )
479
480
480
481
self ._subwidget = QRenderWidget (self , ** kwargs )
Original file line number Diff line number Diff line change @@ -429,11 +429,16 @@ class WxRenderCanvas(WrapperRenderCanvas, wx.Frame):
429
429
# Most of this is proxying stuff to the inner widget.
430
430
431
431
def __init__ (self , parent = None , ** kwargs ):
432
+ # There needs to be an application before any widget is created.
432
433
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.
433
436
super ().__init__ (parent )
434
437
435
438
self ._subwidget = WxRenderWidget (parent = self , ** kwargs )
439
+
436
440
self .Bind (wx .EVT_CLOSE , lambda e : self .Destroy ())
441
+
437
442
self .Show ()
438
443
self ._final_canvas_init ()
439
444
You can’t perform that action at this time.
0 commit comments