Kivy窗口set_title更改回主文件名 [英] Kivy window set_title changes back to main file name
本文介绍了Kivy窗口set_title更改回主文件名的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
设置窗口标题时,标题将重新设置为其对应的文件名.
When I set the window title, the title is set back to it's corresponding file name.
class myniceApp(App):
global Window
def build(self):
Window.clearcolor = (.95,.95,.95,1)
Window.size = (1024, 768)
Window.set_title('mykivyapp')
Builder.load_string(style)
homewin = MyniceappHome()
homewin.initapp()
return homewin
myniceApp().run()
在上面的示例中,最初显示了标题"mykivyapp",但设置为homewin.initapp()之后的文件名
In the above example, the title 'mykivyapp' is shown initially but set back to the filename after homewin.initapp()
应如何使用set_title()?
How should set_title() be used?
推荐答案
Window title is set with App.title
, not with Window directly:
class MyApp(App):
def build(self):
self.title = 'Hello world'
这篇关于Kivy窗口set_title更改回主文件名的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文