Fix AttributeError on startup: resolve App.slot_var via winfo_toplevel
ScreenshotFrame previously read master.master.slot_var, but master is the Notebook and master.master is the inner padding Frame inside App._build, not App. Use winfo_toplevel() so we always reach the App where slot_var lives. Reported as: AttributeError: 'Frame' object has no attribute 'slot_var' at gui.py:401 during run.py startup.
This commit is contained in:
@@ -398,7 +398,7 @@ class ScreenshotFrame(ttk.Frame):
|
||||
def __init__(self, master, on_confirmed) -> None:
|
||||
super().__init__(master, padding=6)
|
||||
self.on_confirmed = on_confirmed
|
||||
self.slot_var = master.master.slot_var # type: ignore[attr-defined]
|
||||
self.slot_var = master.winfo_toplevel().slot_var # type: ignore[attr-defined]
|
||||
self.image: Optional[Image.Image] = None
|
||||
self.bbox: Optional[Tuple[int, int, int, int]] = None
|
||||
self.cells: List[CellResult] = []
|
||||
|
||||
Reference in New Issue
Block a user