Skip to content

Commit

Permalink
update delete image button, now delete drom list
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio0410 committed Dec 21, 2022
1 parent b42bd7c commit 4427f89
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)

def select_file():
def upload_file():
path_list = []
filetypes = (('images files', '*.jpg'),('All files', '*.*'))

Expand All @@ -26,6 +26,10 @@ def select_file():
listbox.insert(0 ,element)
return

def delete_file():
listbox.delete(tk.ANCHOR)
return

window = Tk()

window.geometry("800x600")
Expand All @@ -45,13 +49,13 @@ def select_file():

#Remove button, on click remove a path from the listbox-
remove_button_image = PhotoImage(file=relative_to_assets("button_3.png"))
remove_button = Button(image=remove_button_image, borderwidth=0, highlightthickness=0, command=lambda: print("delete"), relief="flat")
remove_button = Button(image=remove_button_image, borderwidth=0, highlightthickness=0, command=delete_file, relief="flat")
remove_button.place(x=550.0, y=310.0, width=200.0, height=50.0)


#Upload button, on click open task to select file-
upload_button_image = PhotoImage(file=relative_to_assets("button_1.png"))
upload_button = Button(image=upload_button_image, borderwidth=0, highlightthickness=0, command=select_file, relief="flat")
upload_button = Button(image=upload_button_image, borderwidth=0, highlightthickness=0, command=upload_file, relief="flat")
upload_button.place(x=550.0, y=380.0, width=200.0, height=50.0)


Expand Down

0 comments on commit 4427f89

Please sign in to comment.