示例#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 val_changed_cb(self, widg: Gtk.SpinButton) -> None:
     """On input callback to set the values to be always two digits"""
     if not widg.val_change_is_changing_entry:
         widg.val_change_is_changing_entry = True
         widg.set_text(widg.get_text().zfill(2))
         widg.val_change_is_changing_entry = False
示例#3
0
 def on_resolution_percentage_output(self,
                                     spin_button: Gtk.SpinButton) -> bool:
     spin_button.set_text(f"{spin_button.get_value_as_int()} %")
     return True
示例#4
0
 def on_output(self, spin_button: Gtk.SpinButton) -> bool:
     spin_button.set_text(f"{spin_button.get_value_as_int()} s")
     return True