from __future__ import annotations import toga class NewRecipeNavButton(toga.Button): def __init__(self, app: toga.App, container: toga.Box): super().__init__(on_press=self.on_press) self.text = "New Recipe" self.container = container self.app = app def on_press(self, widget=None): from ..views.edit_recipe import EditRecipeView self.container.clear() self.container.add(EditRecipeView(self.app)) __all__ = ["NewRecipeNavButton"]