Advertisement
gauravssnl

Moving Title .py

Nov 26th, 2016
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. import appuifw,e32
  2. lock=e32.Ao_lock()
  3. timer_title=e32.Ao_timer()
  4. count=0
  5. t=0.1
  6. def title_app(text):
  7.     global count,t
  8.     #cancel pending timer first
  9.     timer_title.cancel()
  10.     appuifw.app.title=u"%s"%(text[count:])
  11.     count=count+1
  12.     if count >len(text)+1:
  13.         count=0
  14.         appuifw.app.title=u"Title not moving"
  15.         #sleep for 0.5 seconds
  16.         e32.Ao_timer().after(0.5)
  17.     timer_title.after(t,lambda: title_app(text))    
  18. #this function can be used anywhere for scrolling/moving Title
  19. title_app('This is a moving title.It moves')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement