def newbutton(text): button = Button( height=44, size_hint=(0.7, None), text=text, halign='center', valign='middle', ) button.bind(size=button.setter('text_size')) return button
def add_widgets(self): tryout.init(updated=self.updated) floatLayout = FloatLayout(size_hint=(.9, .9)) nav_btn = MDTextButton(text='NAV Plot', pos_hint={ 'center_x': 0.55, 'center_y': 0.7 }) nav_btn.bind(on_press=self.go_nav_plot) floatLayout.add_widget(nav_btn) gl_btn = MDTextButton(text='Gain Loss Plot', pos_hint={ 'center_x': 0.55, 'center_y': 0.6 }) gl_btn.bind(on_press=self.go_gl_plot) floatLayout.add_widget(gl_btn) sec_btn = MDTextButton(text='Sectoral Exposure Plot', pos_hint={ 'center_x': 0.55, 'center_y': 0.5 }) sec_btn.bind(on_press=self.go_sec_plot) floatLayout.add_widget(sec_btn) trend_btn = MDTextButton(text='Stock Movement plot', pos_hint={ 'center_x': 0.55, 'center_y': 0.4 }) trend_btn.bind(on_press=self.go_trend_plot) floatLayout.add_widget(trend_btn) self.add_widget(floatLayout) add_home_btn(self)