示例#1
0
文件: timer.py 项目: eginhard/gourmet
 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
示例#2
0
 def on_indent_width(self, sender: Gtk.SpinButton) -> None:
     self.settings.set_int('indent-width', sender.get_value_as_int())
示例#3
0
 def update_lookbehind(self, button: Gtk.SpinButton):
     self.lookbehind = button.get_value_as_int()
     self.update_plot_area(self.state)
示例#4
0
def on_spin_button_changed(spin_button: Gtk.SpinButton, callback: Callable):
    callback(spin_button.get_value_as_int())
示例#5
0
文件: logtreeview.py 项目: awacha/cct
 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()