1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
| from phyllotaxie import *
from tournesol import *
from marguerite import *
import tkinter
app = tkinter.Tk()
menu = tkinter.LabelFrame(app, text="Legende", borderwidth = 2)
graph = tkinter.Frame(app ,borderwidth = 2)
graph.pack(side =tkinter.RIGHT, padx = 0, pady = 0, expand = 1)
app.title("Simulation phyllotaxie")
app.geometry("1024x768")
Phyl = phyllotaxie(graph, W=600, H = 600)
def lancement():
Phyl.clear()
Phyl.do(choice_angle.get(),lb.selection_get(),choice_distance.get(), choice_epaisseur.get())
choice_angle = tkinter.DoubleVar()
choice_couleur = tkinter.IntVar()
choice_distance = tkinter.IntVar()
choice_epaisseur = tkinter.IntVar()
label_angle45 = tkinter.Checkbutton(menu, text = "angle 45", variable = choice_angle, onvalue = 45.0, offvalue = 0)
label_angle90 = tkinter.Checkbutton(menu, text = "angle 90", variable = choice_angle, onvalue = 90.0, offvalue = 0)
label_angle137 = tkinter.Checkbutton(menu, text = "angle 137.5", variable = choice_angle, onvalue = 137.5, offvalue = 0)
label_angle180 = tkinter.Checkbutton(menu, text = "angle 180", variable = choice_angle, onvalue = 180.0, offvalue = 0)
lb = tkinter.Listbox(menu)
lb.insert(1, "black")
lb.insert(2, "orange")
lb.insert(3, "blue")
lb.insert(4, "violet")
lb.insert(5, "grey")
label_distance = tkinter.Scale(menu, orient = 'horizontal', label = 'Distance entre les points', length=150, from_=0, to=10, variable = choice_distance)
label_epaisseur = tkinter.Scale(menu, orient = 'horizontal', label = 'Épaisseur des points', from_=0, to=10, length=150, variable = choice_epaisseur)
start_btn = tkinter.PhotoImage(file='images/start.png')
btn_lancement = tkinter.Button(menu, image=start_btn, command = lancement)
stop_btn = tkinter.PhotoImage(file='images/start.png')
btn_pause = tkinter.Button(menu, text = "pause", command = Phyl.pause)
label_angle45.pack()
label_angle90.pack()
label_angle137.pack()
label_angle180.pack()
lb.pack(ipadx=0,ipady=0,expand = 1)
label_distance.pack()
label_epaisseur.pack()
btn_lancement.pack(padx=0,pady=0,expand = 1)
btn_pause.pack(expand = 1)
menu.pack(side=tkinter.LEFT, ipadx = 25, ipady = 25, expand = 1)
app.mainloop() |
Partager