Skip to content

Commit

Permalink
main frame centered at the start
Browse files Browse the repository at this point in the history
  • Loading branch information
Flavio0410 committed Dec 24, 2022
1 parent 2432778 commit 081759a
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions gui/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from tkinter.messagebox import showinfo
from tkinter import Listbox
from image_slider import *
import tkinter

from os import getcwd

Expand Down Expand Up @@ -42,10 +43,17 @@ def delete_file():


window = Tk()

window.geometry("800x600")
screen_width = window.winfo_screenwidth() # Width of the screen
screen_height = window.winfo_screenheight() # Height of the screen

# Calculate Starting X and Y coordinates for Window
x = (screen_width/2) - (800/2)
y = (screen_height/2) - (600/2)

window.geometry('%dx%d+%d+%d' % (800, 600, x, y)) # Set the window size and center in the screen
window.configure(bg="#FFFFFF")


# Main frame
main_frame = Canvas(master=window, bg="#FFFFFF", height=600,
width=800, bd=0, highlightthickness=0, relief="ridge")
Expand Down Expand Up @@ -103,5 +111,4 @@ def build():
window.title("Exposure fusions")
window.mainloop()


build()

0 comments on commit 081759a

Please sign in to comment.