examples/canvas/clearbuffers.py button slides both ways

This commit is contained in:
Charles Merriam 2015-02-01 00:14:45 -08:00
parent 2732194e01
commit d0f979c49d
1 changed files with 4 additions and 1 deletions

View File

@ -78,7 +78,10 @@ class ScreenLayerApp(App):
f.add_widget(b)
def anim_btn(*args):
if b.pos[0] == 0:
Animation(x=f.width-b.width).start(b)
else:
Animation(x=0).start(b)
b.bind(on_press=anim_btn)
return f