
#%Default Imports
from tkinter import *
from tkinter import ttk
import sys
from VIStk.Structures._VINFO import getPath as _getPath
_proj = _getPath()
if _proj and _proj not in sys.path:
    sys.path.insert(0, _proj)
#%File Specific Imports

#%Handle Arguments

#%Screen Modules
# Auto-generated by stitch: from modules import <ScreenName>
#%Define Loop Modules
def loop():
    """Per-frame screen tick.

    Called every iteration of the main update loop -- in standalone
    mode and in the Host -- as fast as Tk can pump events.  No
    framework-level throttle.  Use it for background polling, file
    mtime checks, status refreshes; if you need a slower cadence,
    rate-limit inside your own ``loop()`` body (timestamp gating,
    counter mod-N, etc.).
    """
    pass

# ── Host hooks ────────────────────────────────────────────────────────────────
# configure_menu, on_focused, on_unfocused, and on_quit are called by the Host.
# They are ignored when running standalone (python ScreenName.py).

def configure_menu(tabmanager):
    """Register menu items with the containing TabManager.
    Called each time this tab gains focus, after defaults are restored.
    Use tabmanager.register_menu_item(label, command) or
    tabmanager.add_cascade(label, items)."""
    pass

def on_focused():
    """Called when this tab gains focus."""
    pass

def on_unfocused():
    """Called when this tab loses focus."""
    pass

def on_quit() -> bool:
    """Called when this screen is about to be destroyed.
    Return False to prevent destruction (e.g. unsaved changes prompt).
    Return True or None to allow destruction."""
    pass

def setup(parent):
    """Build this screen's UI into parent.
    Called by the Host with the tab frame. All widget creation goes here."""
    #%Screen Grid

    #%Screen Elements

# ── Standalone entry point ────────────────────────────────────────────────────
# Run this file directly (python ScreenName.py) to test this screen in
# isolation without launching the full Host. Navigation and menubar hooks
# are not active in this mode.
if __name__ == "__main__":
    from Screens.root import root, frame
    setup(frame)
    root.Active = True
    root.WindowGeometry.setGeometry(width=66, height=66, align="center", size_style="screen_relative")
    root.screenTitle("<title>")

    while True:
        try:
            if root.Active:
                try: loop()
                except: pass
                root.update()
            else:
                break
        except:
            break
