How to capture events on tkinter child widgets?

后端 未结 4 1814
谎友^
谎友^ 2021-02-15 13:51

In the following block, clicking on a_frame triggers the event handler on_frame_click, but clicking on a_label which is a child of a

4条回答
  •  北海茫月
    2021-02-15 13:59

    Depending on what you're trying to do, you could bind everything

    print(a_label.bindtags())  # ('.!frame.!label', 'Label', '.', 'all')
    
    tk.bind_class('.', "

提交回复
热议问题