def build(self):
global root
root = ROOT() #set root widget (does nothing)
clockwidget = CLOCK() #sets clock widget
messagewidget = MESSAGE() #sets the message widget
analogclock = MyClockWidget() #sets the analog clock widget
cabintempwidget = CabinTempWidget() #sets the temp widget in upper right corner on main screen
obdgaugewidget = OBDGaugeWidget() #sets the gauge widget in the middle of the screen
Clock.schedule_interval(clockwidget.update, .1) #updates the main menu clock
Clock.schedule_interval(analogclock.ticks.update_clock, .1) #updates the analog clock
Clock.schedule_interval(messagewidget.update, .104556) #updates the message display
#Clock.schedule_once(cabintempwidget.update) #call once to get initial temp
Clock.schedule_interval(cabintempwidget.update, .1) #updates the temp every 10th second
Clock.schedule_interval(obdgaugewidget.update, .1) #updates the temp every 10th second
#add the widgets
root.add_widget(KVFILE) #adds the main GUI
root.add_widget(clockwidget) #main digital clock
root.add_widget(analogclock) #analog clock
root.add_widget(messagewidget) #adds message widget
root.add_widget(cabintempwidget) #adds temp widget
root.add_widget(obdgaugewidget) #adds obd gauge widget
return root
评论列表
文章目录