def __init__(self): global decorations if not yutani.yutani_lib: yutani.Yutani() if not decorations: decorations = yutani.Decor() self.decorated = True self._win = None self.title = "TTK Window"
# Do unfocus stuff here else: changed = False if changed or redraw: self.draw() def keyboard_event(self, msg): if msg.event.action == yutani.KeyAction.ACTION_DOWN: if not self.input.is_focused: self.input.focus_enter() self.input.keyboard_event(msg) # Do keyboard stuff here if __name__ == '__main__': yutani.Yutani() d = yutani.Decor() title = "Input Box" if len(sys.argv) < 2 else sys.argv[1] icon = "default" if len(sys.argv) < 3 else sys.argv[2] def print_text(text_box): print(text_box.text()) sys.exit(0) window = TextInputWindow(d, title, icon, callback=print_text) window.draw() yutani_mainloop.mainloop()
os.waitpid(-1, os.WNOHANG) except ChildProcessError: pass panel.current_time = tick panel_window.draw() if __name__ == '__main__': if os.getuid() != 0: print( "This is the GUI login client. You should not be running this. It is run by the GUI session manager." ) sys.exit(1) print("Hello", flush=True) yutani.Yutani() d = yutani.Decor() # Just in case. panel.current_time = int(time.time()) window = LoginWindow() window.draw() prompts = InputWindow() prompts.draw() def restart_callback(): def confirm(): print(f"RESTART", flush=True) sys.exit(0) DialogWindow(d,