diff --git a/src/main.py b/src/main.py index bfa5e3c..6d9dfa6 100644 --- a/src/main.py +++ b/src/main.py @@ -27,6 +27,7 @@ def main() -> None: last_title = t root = tkinter.Tk() + root.title("PDF Navigation Annotator Tool") frm = ttk.Frame(root, padding=10) frm.grid() @@ -45,6 +46,19 @@ def main() -> None: page_view = ttk.Label(frm) page_view.grid(column=2, row=1) + def start_rect(event): + if event.num != 1: + return + print(f"DOWN @ {event.x}/{event.y}") + + def end_rect(event): + if event.num != 1: + return + print(f"UP @ {event.x}/{event.y}") + + page_view.bind("", start_rect) + page_view.bind("", end_rect) + def load_page(page_num: int): page = doc[page_num] pix = page.get_pixmap() @@ -70,6 +84,17 @@ def main() -> None: ttk.Button(frm, text="Previous", command=previous_page).grid(column=1, row=1, sticky="NS", padx=5, pady=5) ttk.Button(frm, text="Next", command=next_page).grid(column=3, row=1, sticky="NS", padx=5, pady=5) + root.bind("", lambda _: previous_page()) + root.bind("", lambda _: previous_page()) + root.bind("", lambda _: previous_page()) + + root.bind("", lambda _: next_page()) + root.bind("", lambda _: next_page()) + root.bind("", lambda _: next_page()) + + # Broken: + # root.bind("", lambda _: root.destroy) + load_page(CURRENT_PAGE) root.mainloop()