Set text background : Text « Tkinker « Python Tutorial






Set text background
from Tkinter import *
def onclick():
    pass

root = Tk()
text = Text(root)
text.insert(INSERT, "Here, I start the text ...") 
text.insert(END, "... and here, I finish it.")
text.pack()
text.tag_add("here", "1.0", "1.4")
text.tag_add("start", "1.8", "1.13")
text.tag_config("here", background="yellow", foreground="blue")
text.tag_config("start", background="black", foreground="green")
root.mainloop()








18.30.Text
18.30.1.Set text backgroundSet text background
18.30.2.A simple text or file viewer componentA simple text or file viewer component
18.30.3.Disabled Text controlDisabled Text control
18.30.4.Turn Text control to a password input fieldTurn Text control to a password input field
18.30.5.Text with pre-set valueText with pre-set value