-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First commit GUI, create main frame and button
- Loading branch information
1 parent
4657bf8
commit 319c7cf
Showing
4 changed files
with
113 additions
and
1 deletion.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
|
||
# This file was generated by the Tkinter Designer by Parth Jadhav | ||
# https://github.com/ParthJadhav/Tkinter-Designer | ||
|
||
|
||
from pathlib import Path | ||
|
||
# from tkinter import * | ||
# Explicit imports to satisfy Flake8 | ||
from tkinter import Tk, Canvas, Entry, Text, Button, PhotoImage | ||
|
||
|
||
OUTPUT_PATH = Path(__file__).parent | ||
ASSETS_PATH = OUTPUT_PATH / Path(r"/Users/flavio/Desktop/prova/build/assets/frame0") | ||
|
||
|
||
def relative_to_assets(path: str) -> Path: | ||
return ASSETS_PATH / Path(path) | ||
|
||
|
||
window = Tk() | ||
|
||
window.geometry("800x608") | ||
window.configure(bg = "#FFFFFF") | ||
|
||
|
||
canvas = Canvas( | ||
window, | ||
bg = "#FFFFFF", | ||
height = 608, | ||
width = 800, | ||
bd = 0, | ||
highlightthickness = 0, | ||
relief = "ridge" | ||
) | ||
|
||
canvas.place(x = 0, y = 0) | ||
canvas.create_rectangle( | ||
500.0, | ||
0.0, | ||
800.0, | ||
600.0, | ||
fill="#FFFFFF", | ||
outline="") | ||
|
||
canvas.create_text( | ||
500.0, | ||
0.0, | ||
anchor="nw", | ||
text="Exposure fusions", | ||
fill="#000000", | ||
font=("Inter Bold", 36 * -1) | ||
) | ||
|
||
button_image_1 = PhotoImage( | ||
file=relative_to_assets("button_1.png")) | ||
button_1 = Button( | ||
image=button_image_1, | ||
borderwidth=0, | ||
highlightthickness=0, | ||
command=lambda: print("button_1 clicked"), | ||
relief="flat" | ||
) | ||
button_1.place( | ||
x=550.0, | ||
y=175.0, | ||
width=200.0, | ||
height=50.0 | ||
) | ||
|
||
button_image_2 = PhotoImage( | ||
file=relative_to_assets("button_2.png")) | ||
button_2 = Button( | ||
image=button_image_2, | ||
borderwidth=0, | ||
highlightthickness=0, | ||
command=lambda: print("button_2 clicked"), | ||
relief="flat" | ||
) | ||
button_2.place( | ||
x=550.0, | ||
y=440.0, | ||
width=200.0, | ||
height=50.0 | ||
) | ||
|
||
canvas.create_text( | ||
501.0, | ||
574.0, | ||
anchor="nw", | ||
text="©Copyright 2022 Gezzi and Loi", | ||
fill="#000000", | ||
font=("Inter", 12 * -1) | ||
) | ||
|
||
canvas.create_rectangle( | ||
549.0, | ||
399.0, | ||
750.0, | ||
400.0, | ||
fill="#000000", | ||
outline="") | ||
|
||
canvas.create_rectangle( | ||
0.0, | ||
0.0, | ||
500.0, | ||
600.0, | ||
fill="#D9D9D9", | ||
outline="") | ||
window.resizable(False, False) | ||
window.mainloop() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,4 +60,4 @@ def main(): | |
app.mainloop() | ||
|
||
|
||
#main() | ||
main() |