Open a file dialog to select a PDF file and display its name in the text box.
(self)
| 108 | return Font(size=size) |
| 109 | |
| 110 | def file_input(self): |
| 111 | """ |
| 112 | Open a file dialog to select a PDF file and display its name in the text box. |
| 113 | """ |
| 114 | file_type = dict(defaultextension=".pdf", filetypes=[("pdf file", "*.pdf")]) |
| 115 | file_path = filedialog.askopenfilename(**file_type) |
| 116 | |
| 117 | if file_path: |
| 118 | self.path.append(file_path) |
| 119 | file_name = file_path.split("/")[-1] |
| 120 | self.text_box.delete(1.0, tk.END) |
| 121 | self.text_box.insert(tk.INSERT, file_name) |
| 122 | |
| 123 | def clear_all(self): |
| 124 | """ |