Couleurs et taille texte dans un widget Text
Bonjour,
je crée un pop-up topLevel dans lequel j'insère du texte. J'utilise python 3.6.
Sauriez-vous comment faire pour configurer le background, le foreground et la taille du texte, svp?
Merci de votre aide,
Cordialement
Arsene
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| import tkinter as tk
from tkinter import *
fenetre = Tk()
top = Toplevel(fenetre)
print(top.geometry(), fenetre.geometry()) # Affiche 1x1+0+0 1x1+0+0
top.geometry("{}x{}+{}+{}".format(300, 600, 400, 400))
bouton = Button(top, text = "Ok", command = fenetre.destroy)
bouton.pack()
text = Text(top)
text.insert(INSERT, "Nam sole orto magnitudine angusti gurgitis sed profuns denseta scutorum")
text.tag_config(INSERT, bg="black", fg="green")
text.pack()
top.configure(background='black')
fenetre.mainloop() |