Label et bouton dans une sous-frame
bonjour,
J'utilise un notebook pour créer des onglets...
Dans l'un de ces onglets, j'ai créé des frames mais lorsque je veux inssérer des label ou des boutons, rien ne s'affiche :(
Code:
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
| root = Tk()
root.configure(padx = 10, pady = 10)
root.resizable(False, False)
w = 1500
h = 850
ws = root.winfo_screenwidth()
hs = root.winfo_screenheight()
#calcul la position de la fenetre
x = (ws/2) - (w/2)
y = (hs/2) - (h/2)
#applique la taille et la position
root.geometry('%dx%d+%d+%d' % (w, h, x, y))
root.protocol("WM_DELETE_WINDOW")
note = Notebook(root)
tab1 = Frame(note)
tab2 = Frame(note)
tab3 = Frame(note)
tab4 = Frame(note)
tab5 = Frame(note)
tab6 = Frame(note)
note.add(tab1, text = "Onlget 1")
note.add(tab2, text = "Onglet 2")
note.add(tab3, text = "Onglet 3")
note.add(tab4, text = "Onglet 4")
note.add(tab5, text = "Onglet 5")
note.add(tab6, text = "test frames dans onglet")
note.pack()
f1 = Frame(tab6, height = 100, width = 1500, bg ="yellow").pack()
f2 = Frame(tab6, height = 575, width = 1500, bg ="red").pack()
f3 = Frame(tab6, height = 100, width = 1500, bg ="green").pack()
Label(f1, text = "test").pack() |
Je dois sûrement faire une erreur quelque part, puisque mon label ne s'affiche pas, mais je ne trouve pas...