Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    def populate_list(self, toggled_text = None):
        if toggled_text is None: toggled_text = []
        self.canvas.clear()
        self.clear_widgets()
        for each in self.variable_list:
            variable_button = ToggleButton(text = each, on_release = self.button_press)
            if self.radio_button_mode:
                variable_button.group = self
            self.add_widget(variable_button)
            self.current_buttons.append(variable_button)
        self.height = len(self.variable_list) * (self.row_default_height + self.spacing)

        for label in toggled_text:
            self.set_state(label, 'down')