Skip to content

App

App is the root application window — the starting point for every bootstack application.

It wraps Tk with sensible defaults: theme initialization, DPI awareness, window sizing, and shortcut management.


Quick start

import bootstack as bs

app = bs.App(title="My App", theme="cosmo-light", minsize=(800, 600))

bs.Label(app, text="Hello, world!").pack(padx=20, pady=20)

app.mainloop()

When to use

Use App when:

  • you need a basic application window without built-in navigation

  • you want full control over the layout

Consider a different control when:

  • you need a sidebar + toolbar + page scaffold — use AppShell

  • you need a secondary window — use Toplevel


Examples and patterns

Window configuration

app = bs.App(
    title="My App",
    theme="cosmo-dark",
    minsize=(1024, 768),
    position=(100, 100),
    minsize=(640, 480),
    resizable=(True, True),
)

Theme switching

bs.set_theme("flatly-dark")
bs.toggle_theme()  # switches between light and dark

Additional resources

  • AppShell — app window with built-in navigation

  • Toplevel — secondary windows

API reference