diff --git a/pdf-sign b/pdf-sign index c0532dc..df2fa7f 100755 --- a/pdf-sign +++ b/pdf-sign @@ -225,6 +225,7 @@ def main(args): @Cell def updateTitle(): root.title(f'Signing page {pageNumber()}/{pageCount} of {filePath}') + @tkthrottle(100, root) def update(): (w, h) = displaySize() root._docImg = tk.PhotoImage(file=displayPNG()) @@ -308,6 +309,27 @@ class Cell(): d.dirty() self._dependents=[] +def tkthrottle(frequency, root): + wait=1/frequency + now=lambda: time.time() + def decorator(fn): + def throttled(): + if(throttled._suppressUntil