【发布时间】:2016-06-15 15:27:31
【问题描述】:
我想知道instance这个词在kivy中是什么意思?
class CustomBtn(Widget):
pressed = ListProperty([0, 0])
def on_touch_down(self, touch):
if self.collide_point(*touch.pos):
self.pressed = touch.pos
# we consumed the touch. return False here to propagate
# the touch further to the children.
return True
return super(CustomBtn, self).on_touch_down(touch)
def on_pressed(self, instance, pos):
print ('pressed at {pos}'.format(pos=pos))
print ('My callback is call from', instance)
【问题讨论】:
标签: kivy kivy-language