@@ -79,7 +79,6 @@ class Menus:
7979 parent (tk.Tk | tk.Frame): The main window or parent frame.
8080 canvas (tk.Canvas): The canvas widget for drawing circuits.
8181 board (Breadboard): The Breadboard instance.
82- model (list): The model data for the circuit.
8382 current_dict_circuit (dict): The current circuit data.
8483 com_port (str | None): The selected COM port.
8584 """
@@ -122,10 +121,7 @@ def __init__(
122121 menus = {
123122 "Fichier" : ["Nouveau" , "Ouvrir" , "Enregistrer" , "Quitter" ],
124123 "Microcontrôleur" : ["Choisir un microcontrôleur" , "Table de correspondance" , "Configurer le port série" ],
125- "Exporter" : [
126- "Vérifier" ,
127- "Téléverser" ,
128- ],
124+ "Exporter" : ["Vérifier" , "Téléverser" ],
129125 "Aide" : ["Documentation" , "À propos" ],
130126 }
131127
@@ -144,6 +140,16 @@ def __init__(
144140 for menu_name , options in menus .items ():
145141 self .create_menu (menu_name , options , menu_commands )
146142
143+ # Display selected microcontroller label
144+ self .microcontroller_label = tk .Label (
145+ self .menu_bar ,
146+ text = "(Aucun microcontrôleur n'est choisi)" ,
147+ bg = "#333333" ,
148+ fg = "white" ,
149+ font = ("FiraCode-Bold" , 12 ),
150+ )
151+ self .microcontroller_label .pack (side = "right" , padx = 10 )
152+
147153 # Bind to parent to close dropdowns when clicking outside
148154 self .parent .bind ("<Button-1>" , self .close_dropdown , add = "+" )
149155 self .canvas .bind ("<Button-1>" , self .close_dropdown , add = "+" )
@@ -171,6 +177,8 @@ def confirm_selection():
171177 print (f"Selected option: { selected_option } " )
172178 self .selected_microcontroller = selected_option
173179 print (f"{ selected_option } selected." )
180+ # Update the label text
181+ self .microcontroller_label .config (text = self .selected_microcontroller )
174182 dialog .destroy ()
175183
176184 confirm_button = tk .Button (dialog , text = "Confirmer" , command = confirm_selection )
0 commit comments