I can not set title of top level

牧云@^-^@ 提交于 2019-12-02 08:13:13

You try to set Toplevel title with:

master.title = 'Top'

but the correct syntax is:

master.title('Top')

There are a couple of additional things: You do not need an additional mainloop for the Toplevel window. From the code it looks like you think that the Toplevel is a new application, instantiating it with app = AppTop(master = top). But it's just a new window which runs under the appapp.mainloop().

AppTop() inherits from tk.Frame() but you never use it. Instead you put all the widgets directly in the Toplevel (master) window. Same goes for Application() as well.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!