Advertisement
Guest User

Untitled

a guest
Oct 25th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. class app:
  2. def __init__(self):
  3. self.window = Tk()
  4. self.button = Button(self.window,text="Button",command=self.someCommand,state=DISABLED)
  5.  
  6. self.button.bind("<Enter>", self.showText)
  7. self.button.bind("<Leave>", self.hideText)
  8.  
  9. self.window.mainloop()
  10.  
  11. def showText(self):
  12. if self.button["state"] == DISABLED:
  13. #print this text on a canvas
  14. else:
  15. #print that text on a canvas
  16.  
  17. def hideText(self):
  18. #remove text
  19.  
  20. def main()
  21. instance = app()
  22.  
  23. main()
  24.  
  25. self.button['state']
  26. == 'disabled'
  27. == 'DISABLED'
  28.  
  29. print(self.button["state"] == DISABLED)
  30.  
  31. False
  32.  
  33. self.button["state"] = NORMAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement