tkinter left clicks on a TAB in your GUI. How to detect when user has done this

Viewed 2433

I have a GUI written in tkinter and all works fine. I want to enhance it so that when a user left clicks on a certain tab with the mouse, a method is executed. I thought this would be straight forward but I can't get it working. My code is

def f_x():
    print('entered this method')

tab4e = ttk.Frame(notebook2,width=C_WIDTH,height=C_TAB_HEIGHT)
tab4e.bind("<Button-1>",f_x())
3 Answers
Related