def __init__(self, text="", window=None, batch=None, group=None, theme=None, on_escape=None, have_focus=False): def on_ok(_): if on_escape is not None: on_escape(self) self.delete() button = FocusButton("Ok", on_press=on_ok) Manager.__init__(self, content=Frame(VerticalContainer([Label(text), button])), window=window, batch=batch, group=group, theme=theme, is_movable=True) Manager.set_next_focus(self, 1)
def setUp(self): TestPygletGUI.setUp(self) self.button = FocusButton(label="test") GenericButtonTest.setUp(self)