29 lines
827 B
Python
29 lines
827 B
Python
|
|
from __future__ import annotations
|
||
|
|
|
||
|
|
import toga
|
||
|
|
from .data.db import init_database
|
||
|
|
|
||
|
|
|
||
|
|
class FunkyJuiceRecipesApp(toga.App):
|
||
|
|
def startup(self) -> None:
|
||
|
|
# Create the main window with the required title
|
||
|
|
# Initialize database and run migrations before showing UI
|
||
|
|
init_database(self)
|
||
|
|
self.main_window = toga.MainWindow(title="FunkyJuice Recipes")
|
||
|
|
# An empty content box for now (satisfies blank window acceptance)
|
||
|
|
self.main_window.content = toga.Box()
|
||
|
|
self.main_window.show()
|
||
|
|
|
||
|
|
|
||
|
|
def main() -> FunkyJuiceRecipesApp:
|
||
|
|
"""Entry point for Briefcase and CLI execution.
|
||
|
|
|
||
|
|
Returns a constructed, not-yet-started app instance.
|
||
|
|
"""
|
||
|
|
return FunkyJuiceRecipesApp("funkyjuicerecipes", "com.TargonProducts")
|
||
|
|
|
||
|
|
|
||
|
|
if __name__ == "__main__":
|
||
|
|
app = main()
|
||
|
|
app.main_loop()
|