Esempio n. 1
0
 def show(self, text, duration=0.3):
     self.text = text
     if self.visible:
         return
     # animate from hidden to shown
     self.visible = True
     anim = Animation(scale=1, duration=duration)
     anim.name = 'show'
     self._start(anim)
Esempio n. 2
0
    def hide(self, duration=0.3):
        if not self.visible:
            return
        #
        def cleartext(anim, widget):
            self.text = ''

        #
        self.visible = False
        anim = Animation(scale=0, duration=duration)
        anim.bind(on_complete=cleartext)
        anim.name = 'hide'
        self._start(anim)