-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPDFLabel.py
32 lines (19 loc) · 831 Bytes
/
PDFLabel.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import tkinter.ttk as ttk
import tkinter as tk
class PDFLabel(ttk.Frame):
def __init__(self, parent, PDFName, row, master=None):
super().__init__(master)
self.parent= parent
self.name = PDFName
self.row = row
self.trashIcon = tk.PhotoImage(file="trash.png")
self.grid(row=0, column=0, columnspan=2)
self.PDFFileLabel = ttk.Label(self.parent, text=self.name)
self.PDFFileLabel.grid(row=row, column=0)
self.deleteButton = ttk.Button(self.parent, image=self.trashIcon, command=self.deleteSelfFromPDFList)
self.deleteButton.grid(row=row, column=1)
def deleteSelfFromPDFList(self):
self.parent.master.updateLabelFrame(self)
def destroy(self):
self.PDFFileLabel.destroy()
self.deleteButton.destroy()