I am trying to see different fonts and how they look in tkinter but they are going outside the window. I saw other answers on this and how to add a scrollbar but none of them are working. So is there a way I can add a scrollbar in my app or any other solution so I can view all Fonts.
Thanks
This is my code
from tkinter import Tk, font, Label
root = Tk()
x = font.families()
for i in x:
l = Label(root, text=i, font=(i, 12))
l.pack()
root.mainloop()
Can someone pls help
CodePudding user response:
from tkinter import Tk, font, Label
root = Tk()
row=0
col=0
x = font.families()
for i in x:
l = Label(text=i, font=(i, 10))
l.grid(column=col,row=row)
row =1
if row>23:
row=0
col =1
root.mainloop()