def val_changed_cb(self, widget: Gtk.SpinButton): """On input callback to set the values to be always two digits""" if not widget.val_change_is_changing_entry: widget.val_change_is_changing_entry = True value = widget.get_value_as_int() value = min(value, 59) widget.set_text(str(value).zfill(2)) widget.val_change_is_changing_entry = False
def on_indent_width(self, sender: Gtk.SpinButton) -> None: self.settings.set_int('indent-width', sender.get_value_as_int())
def update_lookbehind(self, button: Gtk.SpinButton): self.lookbehind = button.get_value_as_int() self.update_plot_area(self.state)
def on_spin_button_changed(spin_button: Gtk.SpinButton, callback: Callable): callback(spin_button.get_value_as_int())
def on_nentries_changed(self, spinbutton: Gtk.SpinButton): self.nentries = spinbutton.get_value_as_int() model = self.builder.get_object('logstore') while len(model) > self.nentries: model.remove(model.get_iter_first()) self.update_shown_count()