Skip to content

Commit

Permalink
input images button work
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio0410 committed Dec 20, 2022
1 parent 1cf2947 commit 6e9bb2c
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 7 deletions.
35 changes: 28 additions & 7 deletions gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
# from tkinter import *
# Explicit imports to satisfy Flake8
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage
from tkinter import filedialog as fd
from tkinter.messagebox import showinfo


OUTPUT_PATH = Path(__file__).parent
Expand All @@ -17,6 +19,19 @@
def relative_to_assets(path: str) -> Path:
return ASSETS_PATH / Path(path)

def select_file():
filetypes = (('images files', '*.jpg'),('All files', '*.*'))

filename = fd.askopenfilename(
title='Open a file',
initialdir='/',
filetypes=filetypes)

showinfo(
title='Selected File',
message=filename
)


window = Tk()

Expand Down Expand Up @@ -44,12 +59,12 @@ def relative_to_assets(path: str) -> Path:
outline="")

canvas.create_text(
500.0,
0.0,
570,
30.0,
anchor="nw",
text="Exposure fusions",
text="Exposure \n fusions",
fill="#000000",
font=("Inter Bold", 36 * -1)
font=("Inter Bold", 38 * -1)
)

button_image_1 = PhotoImage(
Expand All @@ -58,7 +73,7 @@ def relative_to_assets(path: str) -> Path:
image=button_image_1,
borderwidth=0,
highlightthickness=0,
command=lambda: print("button_1 clicked"),
command=select_file,
relief="flat"
)
button_1.place(
Expand All @@ -68,6 +83,7 @@ def relative_to_assets(path: str) -> Path:
height=50.0
)


button_image_2 = PhotoImage(
file=relative_to_assets("button_2.png"))
button_2 = Button(
Expand Down Expand Up @@ -113,5 +129,10 @@ def relative_to_assets(path: str) -> Path:
600.0,
fill="#D9D9D9",
outline="")
window.resizable(False, False)
window.mainloop()

def create_frame():
window.resizable(False, False)
window.title("Exposure fusions")
window.mainloop()

create_frame()
1 change: 1 addition & 0 deletions gui/image_slider.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import tkinter as tk
from PIL import ImageTk, Image
import gui.py


class Application(tk.Frame):
Expand Down

0 comments on commit 6e9bb2c

Please sign in to comment.