📜  如何在一个按钮 tkteer 上添加 2 个绑定事件 - TypeScript 代码示例

📅  最后修改于: 2022-03-11 14:48:20.191000             🧑  作者: Mango

代码示例1
try:
    import Tkinter as tkinter # for Python 2
except ImportError:
    import tkinter # for Python 3

def on_click_1(e):
    print("First handler fired")

def on_click_2(e):
    print("Second handler fired")

tk = tkinter.Tk()
myButton = tkinter.Button(tk, text="Click Me!")
myButton.pack()

# this first add is not required in this example, but it's good form.
myButton.bind("