单选题

你正在为一个小型游戏设计界面,需要一个按钮,玩家点击后会显示一个消息表示游戏开始。如何绑定一个函数到按钮点击事件,以便在点击时执行?( )

A

button = Button(root, text="开始游戏", command=startGame)

B

button = Button(root, text="开始游戏", onclick=startGame)

C

button = Button(root, text="开始游戏", action=startGame)

D

button = Button(root, text="开始游戏", event=startGame)

赣ICP备20007335号-2