【发布时间】:2017-11-27 17:08:44
【问题描述】:
我想让一个对象出现在用户单击的 tkinter 窗口中。 我有这个代码:
from tkinter import *
class Storage:
def __init__(self):
x = None
circle = None
w=None
class Game:
def Start():
#make object appear where clicked
root = Tk()
w = Canvas(root, width=200, height=100)
w.pack()
w.bind("<Button-1>", Start)
start = Button(text="Start!", command=Game.Start)
start.pack()
root.mainloop()
任何帮助将不胜感激。
【问题讨论】:
标签: python canvas tkinter binding