how to add 2 bind events on one button tkinteer

The solution for “how to add 2 bind events on one button tkinteer” can be found here. The following code will assist you in solving the problem.

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!”)

# this first add is not required in this example, but it’s good form.

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

inline scripts encapsulated in