Salut,
tout est dans le titre... aidez moi svp
Incompréhensible... aucun message d'erreur car le code est correct, quand je retire le label je vois le texte du bouton et quand je mets le label, le texte disparaît...
Ps : si qqn peut m'expliquer pourquoi test2 apparait toujours en premier meme avec row=2.... merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 # -*- coding: utf-8 -*- from tkinter import Frame, Tk, Text, Toplevel import tkinter.ttk as ttk import os import Mission3 as mi3 class Example(Frame): def __init__(self, parent): Frame.__init__(self, parent) self.parent = parent self.initUI() def initUI(self): self.grid(sticky='we') #ttk.Label(self, width=300, text="test??").grid(row=0)#Si je l'enleve je vois test et test2 bouton = ttk.Button(self, text='test2') bouton.grid(sticky='we', row=2) def main(): root = Tk() ex = Example(root) root.geometry("300x300+100+100") bouton = ttk.Button(root, text='test') bouton.grid(sticky='we', row=1) root.mainloop() if __name__ == '__main__': main()
Partager