def add_student_button(self, name, screen): btn_left = ToggleButton() # Make a button for the left side of the screens btn_left.text = name # Set the text of the button to the students name btn_left.size_hint_y = None # Change the vertical height of the button btn_left.height = 40 # Set the height of the button btn_left.group = screen.name # Set the group of the button btn_right = ToggleButton() # Make a button for the right side of the screens btn_right.text = name # Set the text of the button to the students name btn_right.size_hint_y = None # Change the vertical height of the button btn_right.height = 40 # Set the height of the button screen.ids.left.add_widget(btn_left) # Add the button to the left side of the screen screen.ids.right.add_widget(btn_right) # Add the button to the left side of the screen