Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class app:
- def __init__(self):
- self.window = Tk()
- self.button = Button(self.window,text="Button",command=self.someCommand,state=DISABLED)
- self.button.bind("<Enter>", self.showText)
- self.button.bind("<Leave>", self.hideText)
- self.window.mainloop()
- def showText(self):
- if self.button["state"] == DISABLED:
- #print this text on a canvas
- else:
- #print that text on a canvas
- def hideText(self):
- #remove text
- def main()
- instance = app()
- main()
- self.button['state']
- == 'disabled'
- == 'DISABLED'
- print(self.button["state"] == DISABLED)
- False
- self.button["state"] = NORMAL
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement