Search code examples
pythontkintertext-stylingtext-widget

Overline Text in Tkinter


I can apply an underline or overstrike style to text in Text widget.

Is it possible to do an overline?

import tkinter as tk

root = tk.Tk()

text = tk.Text(root)
text.pack(padx=4,pady=4,fill=tk.BOTH,expand=tk.YES)

text.tag_configure('underline', underline=True)
text.tag_configure('overstrike', overstrike=True)

text.insert(tk.END, 'Underline text.\n','underline')
text.insert(tk.END, 'Overstrike text.\n','overstrike')

root.mainloop()

Solution

  • No, it is not possible to do an overline.