ラベル名は必要ありません。ラベルには有用な名前がありません。イベントが発生すると、ウィジェットへの参照が渡されます。このウィジェットは、ウィジェット属性を照会または変更するために使用できます。
ここでは、ラベルをクリックして変更する方法の例を示します。プログラムを実行し、任意のラベルを必要なだけ頻繁にクリックします。
import Tkinter as tk
import time
def on_click(event):
now = time.strftime("%H:%M:%S")
event.widget.configure(text="you clicked me at %s" % now)
root = tk.Tk()
for row in range(4):
for col in range(4):
label = tk.Label(root, width=25, borderwidth=1, relief="sunken")
label.grid(row=row, column=col, padx=2, pady=2)
label.bind("<1>", on_click)
root.mainloop()