refactor(gui)

This commit is contained in:
Kristofers Solo 2023-11-08 12:40:09 +02:00
parent 027e4131be
commit 504e45ebc4

View File

@ -15,6 +15,7 @@ class App(ctk.CTk):
self.data = inventory.list_all()
self.display_table()
self.display_add_button()
def display_table(self) -> None:
headers = Book.fields()
@ -28,8 +29,12 @@ class App(ctk.CTk):
entry = ctk.CTkLabel(self, width=widths[col], text=value)
entry.grid(row=row, column=col, padx=10, pady=5)
open_popup_button = ctk.CTkButton(self, text="Add Book", command=self.add_book)
open_popup_button.grid(row=0, column=5, padx=10, pady=5)
def display_add_button(self) -> None:
add_book_button = ctk.CTkButton(self, text="Add Book", command=self.add_book)
add_book_button.grid(row=0, column=5, padx=10, pady=5)
def search(self) -> None:
pass
def run(self) -> None:
self.mainloop()