Created
April 27, 2020 01:55
-
-
Save jasonblanchard/043b66ac65e3fb4ee2197ca6c47b739e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tkinter | |
def main(): | |
root = tkinter.Tk() | |
canvas = tkinter.Canvas(root, width=200, height=100) | |
canvas.pack() | |
button = tkinter.Button(root, text="test") | |
button.bind("<Button-1>", lambda e: print("left clicked")) | |
button.bind("<Button-2>", lambda e: print("right clicked")) # Should print "right clicked" to the console. Change it to <Button-3> and it won't work | |
button.pack() | |
root.update() | |
root.mainloop() | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment