2023-10-02 22:48:10 +00:00
from tkinter import *
2023-10-03 01:27:29 +00:00
import tkinter as tk
2023-10-02 22:48:10 +00:00
#creation première fenetre
window = Tk ( )
#personnalisation fenêtre
window . title ( " Choix EDS " )
window . geometry ( " 1080x720 " )
window . minsize ( 480 , 360 )
2023-10-02 23:45:19 +00:00
window . maxsize ( 1920 , 1080 )
window . iconbitmap ( " GUI/bitmap.ico " )
window . config ( background = ' #35363a ' )
2023-10-03 01:27:29 +00:00
#CREATIONN DES FRAMES
#création d'une frame principale
2023-10-02 23:45:19 +00:00
frame = Frame ( window , bg = ' #35363a ' )
2023-10-03 01:27:29 +00:00
#création d'une frame haute
highframe = Frame ( frame , bg = ' #35363a ' )
#création d'une frame basse
bottomframe = Frame ( frame , bg = ' #35363a ' )
#création d'une frame gauche
leftframe = Frame ( bottomframe , bg = ' #35363a ' )
#création d'une frame droite
rightframe = Frame ( bottomframe , bg = ' #35363a ' )
#AJOUT ET AFFICHAGE DES ELEMENTS
2023-10-02 23:45:19 +00:00
#ajouter le titre
2023-10-03 01:27:29 +00:00
label_title = Label ( highframe , text = " Aide au choix de la spécialité " , font = ( " Arial " , 31 ) , bg = ' #35363a ' , fg = ' #d9d9d9 ' )
2023-10-02 23:45:19 +00:00
#afficher le titre
label_title . pack ( )
#ajouter la description
2023-10-03 01:27:29 +00:00
label_subtitle = Label ( highframe , text = " Cette application est une assistance pour le choix des EDS et du parcours post BAC " , font = ( " Arial " , 16 ) , bg = ' #35363a ' , fg = ' #a6a6a6 ' )
2023-10-02 23:45:19 +00:00
#afficher la description
label_subtitle . pack ( )
#ajouter un champ de texte
2023-10-03 01:27:29 +00:00
metier = Entry ( leftframe , font = ( " Arial " , 16 ) , bg = ' #35363a ' , fg = ' #a6a6a6 ' )
2023-10-02 23:45:19 +00:00
#afficher le champ de texte
2023-10-03 01:27:29 +00:00
metier . pack ( expand = YES , fill = X , pady = 25 )
2023-10-02 23:45:19 +00:00
2023-10-03 01:27:29 +00:00
#ajouter un bouton
srch_button = Button ( rightframe , text = " Rechercher mes EDS " , font = ( " Arial " , 16 ) , bg = ' #737373 ' , fg = ' #a6a6a6 ' )
2023-10-02 23:45:19 +00:00
#afficher le bouton
2023-10-03 01:27:29 +00:00
srch_button . pack ( )
#AFFICHAGE DES FRAMES
#affichage frame haute
highframe . pack ( side = TOP )
#affichage frame basse
bottomframe . pack ( side = BOTTOM )
#affichage frame droite
rightframe . pack ( side = RIGHT , padx = 10 )
#affichage frame gauche
leftframe . pack ( side = LEFT , padx = 10 )
2023-10-02 23:45:19 +00:00
#afficher la frame
frame . pack ( expand = YES )
2023-10-02 22:48:10 +00:00
2023-10-03 01:27:29 +00:00
#TRAITER INFORMATION USER
#Récupérer l'éntrée dans une variable
# Association de l'évènement actionEvent au champ de saisie
def actionEvent ( event ) :
metier . configure ( metier . get ( ) )
metier . bind ( " <Return> " , actionEvent )
search = StringVar ( metier )
2023-10-02 22:48:10 +00:00
#affichage dans la boucle main
window . mainloop ( )