Browse Source

changemment du bouton

master
Denis Leenaerts 2 weeks ago
parent
commit
a8df30053e
  1. 13
      projet_knn_feat_denis_le_goat.py

13
projet_knn_feat_denis_le_goat.py

@ -109,7 +109,14 @@ def lancerTest():
affichageResultats.configure(text="La consommation électrique devrait être d'environ " + str(ConsoMoy) +"MW") affichageResultats.configure(text="La consommation électrique devrait être d'environ " + str(ConsoMoy) +"MW")
def changeDistance(): def changeDistance():
print("e") global DistanceEuclidienne
if DistanceEuclidienne:
boutonDistance.config(text='Distance de Manhattan')
else:
boutonDistance.config(text='Distance euclidienne')
DistanceEuclidienne = not DistanceEuclidienne
DistanceEuclidienne = False
fenetre = tk.Tk() fenetre = tk.Tk()
fenetre['bg'] = "snow" fenetre['bg'] = "snow"
@ -157,11 +164,11 @@ canvaRecup.grid(row = 9, columnspan = 2)
boutonRecup = tk.Button(fenetre, command = lancerTest, bg = 'snow',text='Valider', boutonRecup = tk.Button(fenetre, command = lancerTest, bg = 'snow',text='Valider',
cursor='hand2') cursor='hand2')
boutonRecup.grid(row = 10) boutonRecup.grid(row = 10,column = 1)
boutonDistance = tk.Button(fenetre, command = changeDistance, text="Distance de Manhattan" boutonDistance = tk.Button(fenetre, command = changeDistance, text="Distance de Manhattan"
,bg='snow',cursor='hand2') ,bg='snow',cursor='hand2')
boutonDistance.grid(row=10, column=1) boutonDistance.grid(row=10, column=0)
affichageResultats = tk.Label(fenetre, bg='snow', text='',font='TkDefaultFont 8 bold') #J'ai du chercher parce qu'on ne peut affichageResultats = tk.Label(fenetre, bg='snow', text='',font='TkDefaultFont 8 bold') #J'ai du chercher parce qu'on ne peut
affichageResultats.grid(row=11) affichageResultats.grid(row=11)

Loading…
Cancel
Save