Kivy 窗口 set_title 改回主文件名 [英] Kivy window set_title changes back to main file name

查看:21
本文介绍了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?

推荐答案

窗口标题设置为 App.title,不直接用Window:

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆