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
|
import tkinter
from tkinter import *
# Creation de la fenêtre de saisie
window = Tk()
window.title("Hexagone creator")
window.geometry("500x500")
window.resizable(width=False, height=False)
window.configure(background="grey")
#Choix des fleuves (checkbutton)
cadre_fleuve = LabelFrame(window, text="Choix des HexSides avec un fleuve", padx=0, pady=0)
cadre_fleuve.place(anchor = "ne" , x=475, y=25, width=200, height=175)
fl = [BooleanVar()] * 6
txt = ["nord", "nord-est", "sud-est", "sud", "sud-ouest", "nord-ouest"]
check_fleuve = [tkinter.Checkbutton(cadre_fleuve)] * 6
i = 0
while i < 6 :
check_fleuve[i].config(variable=fl[i], text= "Fleuve au " + txt[i])
check_fleuve[i].place(x=5, y=5 + 20 * i)
i+=1
# main
window.mainloop() |
Partager