【发布时间】:2017-10-20 20:35:36
【问题描述】:
我有一个用 tkinter 编写的 GUI,一切正常。我想增强它,以便当用户用鼠标左键单击某个选项卡时,会执行一个方法。我认为这将是直截了当的,但我无法让它工作。我的代码是
def f_x():
print('entered this method')
tab4e = ttk.Frame(notebook2,width=C_WIDTH,height=C_TAB_HEIGHT)
tab4e.bind("<Button-1>",f_x())
【问题讨论】:
标签: python function tkinter tabs execute