Skip to content

Commit

Permalink
Python Tktinter Button Mouse on-Hover Popup Message start
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-emarquez committed Sep 15, 2020
1 parent e00c017 commit 094b207
Showing 1 changed file with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,26 @@
root = Tk()
root.title('Python Tktinter Button Mouse on-Hover Popup Message')
root.iconbitmap('Python Tktinter Button Mouse on-Hover Popup Message/elvis.ico')
root.geometry("600x400+-50+50")
root.geometry("500x400")


def button_hover(e):
my_button["bg"] = "white"
status_label.config(text="I m Hovering Over The Button")

def button_hover_leave(e):
my_button["bg"] = "SystemButtonFace"
status_label.config(text="")


my_button = Button(root, text="Click Me", font=("Helvetica", 28))
my_button.pack(pady=50)

status_label = Label(root, text="Test", bd=1, relief=SUNKEN, anchor=E)
status_label.pack(fill=X, side=BOTTOM, ipady=2)

my_button.bind("<Enter>", button_hover)
my_button.bind("<Leave>", button_hover_leave)


root.mainloop()

0 comments on commit 094b207

Please sign in to comment.