以下代码创建了一个简单的图形界面,但点击按钮时没有反应,问题出在没有设置 command 参数绑定事件处理函数。( )
from tkinter import *
def show_message():
message_label.config(text="按钮被点击了!")
root = Tk()
message_label = Label(root, text="等待点击...")
message_label.pack()
my_button = Button(root, text="点击我")
my_button.pack()
root.mainloop()
正在加载题目数据…
子题
该题型需在试卷/作业中作答,单题练习暂不支持
答案解析