X Error of failed request: BadLength (poly request too large or internal Xlib length error) Major opcode of failed request: 139 (RENDER) Minor opcode of failed request: 20 (RenderAddGlyphs) Serial number of failed request: 689 Current serial number in output stream: 783
Hello. I'm using ubuntu 18.04 Mate and I get this error when I execute the python code below. Yet the code is correct.
Here is the code that creates the bug:
import tkinter as tk
import tkinter.font as tkfont
from tkinter.scrolledtext import ScrolledText
root = tk.Tk()
frame = tk.LabelFrame(root, text="Polices")
frame.grid()
ft = tkfont.families()
txt = ScrolledText(frame, width=50, height=20)
txt.grid()
txt.insert("1.0", 'Polices:\n')
txt.tag_add("tagpolices", "1.0", "insert")
for i,f in enumerate(ft):
font = tkfont.Font(frame, size=20, family=f)
tag = f'tag{i}'
txt.tag_config(tag, font=font)
txt.insert("end", f, tag, '\n')
root.mainloop()
How to solve this problem?