问题描述
几周前我开始在 Python 上学习 Tkinter,并想创建一个猜谜游戏。但不幸的是,我遇到了一个问题,使用此代码,规则文本(在函数 Rules; text='Here are the rules...
中)没有出现在窗口( rule_window)上。
window = Tk()
window.title("Guessing Game")
welcome = Label(window,text="Welcome To The Guessing Game!",background="black",foreground="white")
welcome.grid(row=0,column=0,columnspan=3)
def Rules():
rule_window = Tk()
rule_window = rule_window.title("The Rules")
the_rules = Label(rule_window,text='Here are the rules...',foreground="black")
the_rules.grid(row=0,columnspan=3)
rule_window.mainloop()
rules = Button(window,text="Rules",command=Rules)
rules.grid(row=1,columnspan=1)
window.mainloop()
有人知道如何解决这个问题吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)