This commit is contained in:
Mylloon 2023-06-01 11:59:08 +02:00
parent 894ddf9153
commit 0c2abd9b32
Signed by: Anri
GPG key ID: A82D63DFF8D1317F

10
gui.py
View file

@ -16,11 +16,11 @@ class GUI:
def start(self) -> None: def start(self) -> None:
"""Affiche la fenêtre""" """Affiche la fenêtre"""
self._main_screen() self._main_screen()
# self.change_pos(1280, 720) # self._change_pos(1280, 720)
self.parent.title(self.name) self.parent.title(self.name)
self.parent.mainloop() self.parent.mainloop()
def change_pos(self, x: int, y: int) -> None: def _change_pos(self, x: int, y: int) -> None:
"""Change les dimensions de la fenêtre""" """Change les dimensions de la fenêtre"""
width = self.parent.winfo_screenwidth() width = self.parent.winfo_screenwidth()
height = self.parent.winfo_screenheight() height = self.parent.winfo_screenheight()
@ -31,7 +31,7 @@ class GUI:
self.parent.geometry(f"{x}x{y}+{x_i}+{y_i}") self.parent.geometry(f"{x}x{y}+{x_i}+{y_i}")
def _open_file(self): def _open_file(self) -> None:
try: try:
chemin = askopenfile( chemin = askopenfile(
title=f"Choisir un fichier - {self.name}", title=f"Choisir un fichier - {self.name}",
@ -49,7 +49,7 @@ class GUI:
if chemin: if chemin:
return self._analyse(2, chemin.name) return self._analyse(2, chemin.name)
def _open_directory(self): def _open_directory(self) -> None:
try: try:
chemin = askdirectory() chemin = askdirectory()
except AttributeError: except AttributeError:
@ -58,7 +58,7 @@ class GUI:
else: else:
return self._analyse(2, chemin) return self._analyse(2, chemin)
def _main_screen(self): def _main_screen(self) -> None:
"""Écran principal""" """Écran principal"""
Label( Label(
self.parent, self.parent,