def main():
global canvas
root = Tk()
root.title('Tetrahedron')
root.geometry('+0+0')
init()
canvas = Canvas(root, width=400, height=400, background=bgColor)
canvas.pack(fill=BOTH,expand=YES)
canvas.bind("<Button-1>", cbClicked)
canvas.bind("<B1-Motion>", cbMottion)
canvas.bind("<Configure>", resize)
from platform import uname
os = uname()[0]
if ( os == "Linux" ):
canvas.bind('<Button-4>', wheelUp) # X11
canvas.bind('<Button-5>', wheelDown)
elif ( os == "Darwin" ):
canvas.bind('<MouseWheel>', wheel) # MacOS
else:
canvas.bind_all('<MouseWheel>', wheel) # windows
drawTet(tet,tetColor)
mainloop()
评论列表
文章目录