from sprites import Screen,Button,showinfo,mouse_pos
def clickme():
showinfo('啊啊')
screen = Screen()
screen.setup(800,600)
screen.xy_grid()
b = Button(x=100,y=200,text='点我呀',
command=clickme,bg='lime',
height=2,width=10)
c = Button(x=400,y=200,text='点我呀',
command=lambda:showinfo(mouse_pos()),
bg='cyan',height=2,width=10)
screen.mainloop()
|