Fixing bind() exemple (undefined refs).

This commit is contained in:
Julien Miotte 2012-11-20 20:25:08 +01:00
parent 6ff2a698eb
commit e71dcabc1b
1 changed files with 4 additions and 3 deletions

View File

@ -163,9 +163,10 @@ cdef class EventDispatcher(object):
class MyClass(BoxLayout):
def __init__(self):
super(MyClass, self).__init__(**kwargs)
btn = Button(text='click on')
btn.bind(on_press=self.my_callback) #bind event
super(MyClass, self).__init__()
btn = Button(text='click me')
# Bind event to callback
btn.bind(on_press=self.my_callback)
self.add_widget(btn)
def my_callback(self,obj,value):