My goal is to bind an Event to the window. For example I want a function called when the mouse pointer enters the window. The code below does this but sadly the function is also called whenever the mouse pointer enters the Button. I tried B.unbind("<Enter>")
but it does not work. Any help would be appreciated
import tkinter as tk
root = tk.Tk()
def function(event):
print("Hello World")
B = tk.Button(root, text ="Label")
root.bind("<Enter>",function)
root.geometry("100x100")
B.pack()
root.mainloop()