python – 在Tkinter中覆盖文本

我可以在文本小部件中对文本应用下划线或重写样式.

是否可以进行上线?

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()

最佳答案 不,不可能进行上线.

点赞