事件冒泡如何在Kivy工作?为什么在回调中调用super()
?例如super(NameClass,self).on_touch_down()
。
class MyWidget(Widget):
def on_touch_down(self, touch):
if <condition>:
...
return True
return super(MyWidget,self).on_touch_down(touch)
另一个问题,为什么在漫游中通过comicwidgets.py在此代码中调用super()
:
def on_touch_down(self, touch):
if self.collide_point(touch.x, touch.y):
self.touched = True
self.select()
super(DraggableWidget, self).on_touch_down(touch) # Why this call?
return True
return super(DraggableWidget, self).on_touch_down(touch)