Files
douyi_guaji_main/gui/dashboard_app/page_context.py
T
2026-06-18 12:51:03 +08:00

25 lines
553 B
Python

from __future__ import annotations
import tkinter as tk
from typing import Callable
Action = Callable[[], None]
class PageContext:
def __init__(
self,
vars_: dict[str, tk.Variable],
texts: dict[str, tk.Text],
actions: dict[str, Action],
) -> None:
self.vars = vars_
self.texts = texts
self.actions = actions
def var(self, name: str) -> tk.Variable | None:
return self.vars.get(name)
def action(self, name: str) -> Action | None:
return self.actions.get(name)