Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Kivy window set_title changes back to main file name

Tags:

kivy

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()

In the above example, the title 'mykivyapp' is shown initially but set back to the filename after homewin.initapp()

How should set_title() be used?

like image 878
Bill Bridge Avatar asked Dec 18 '22 10:12

Bill Bridge


2 Answers

Window title is set with App.title, not with Window directly:

class MyApp(App):
    def build(self):
        self.title = 'Hello world'
like image 176
Peter Badida Avatar answered Mar 08 '23 23:03

Peter Badida


you can use it like below.. this one worked for me.. i tried the first solution explained above, but it did not work.. so i change a bit and put the title outside the build function, its working successfully..

class controllerApp(App):
    title = 'Vehicle Detection System'

    def build(self, video_source=VIDEO_SOURCE):
    ...
    ...

like image 44
nsiderscodes Avatar answered Mar 08 '23 23:03

nsiderscodes