Window title with page and filename

Dieser Commit ist enthalten in:
Axel Svensson 2021-10-11 20:24:44 +02:00
Ursprung ba9cdb2e77
Commit 823ec4b9cb

Datei anzeigen

@ -112,7 +112,6 @@ def main(filePath, pagestr=None):
root.destroy() root.destroy()
# Window and menu # Window and menu
root = tk.Tk() root = tk.Tk()
root.title("Hello Tkinter")
rootmenu = tk.Menu(root) rootmenu = tk.Menu(root)
root.config(menu=rootmenu) root.config(menu=rootmenu)
filemenu = tk.Menu(rootmenu, tearoff=0) filemenu = tk.Menu(rootmenu, tearoff=0)
@ -187,11 +186,15 @@ def main(filePath, pagestr=None):
root._docView.bind('<Configure>', onDocViewResize) root._docView.bind('<Configure>', onDocViewResize)
root._docView.pack(expand=1) root._docView.pack(expand=1)
root._docViewIndex=root._docView.create_image(0, 0, anchor=tk.NW) root._docViewIndex=root._docView.create_image(0, 0, anchor=tk.NW)
@Cell
def updateTitle():
root.title(f'Signing page {pageNumber()}/{pageCount} of {filePath}')
def update(): def update():
(w, h) = displaySize() (w, h) = displaySize()
root._docImg = tk.PhotoImage(file=displayPNG()) root._docImg = tk.PhotoImage(file=displayPNG())
root._docView.itemconfig(root._docViewIndex, image=root._docImg) root._docView.itemconfig(root._docViewIndex, image=root._docImg)
root._docView.configure(width=w, height=h) root._docView.configure(width=w, height=h)
updateTitle()
def onclick(event): def onclick(event):
x=event.x x=event.x
y=event.y y=event.y