[FAQ Tkinter] Comment afficher une fenêtre en plein écran ?
Bonjour,
Il est écrit dans la FAQ
Citation:
De manière très simple, en appliquant l'instruction root.wm_state(newstate="zoomed"), vous afficherez la fenêtre principale en plein écran. Cette instruction ne fonctionne que sous windows
Pour être plus 'universel' cela pourrais être remplacer par
Code:
root.attributes("-fullscreen", 1)
Avec pour code:
Code:
1 2 3 4 5 6 7 8 9 10
| try:
import tkinter as Tk
except:
import Tkinter as Tk
root = Tk.Tk()
root.attributes('-fullscreen', 1)
Tk.Button(root, text="Quit", command=root.destroy).pack()
root.mainloop() |
ou
Code:
1 2 3 4 5 6 7 8 9 10 11
| try:
import tkinter as Tk
except:
import Tkinter as Tk
root = Tk.Tk()
root.attributes('-fullscreen', 1)
button = Tk.Button(root, text="Quit", command=root.destroy)
button.pack()
root.mainloop() |
@+