1

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

Sharim Iqbal
  • 2,724
  • 1
  • 4
  • 24
  • Does this answer your question? [Adding a scrollbar to a group of widgets in Tkinter](https://stackoverflow.com/questions/3085696/adding-a-scrollbar-to-a-group-of-widgets-in-tkinter) – fhdrsdg Jan 13 '22 at 10:53

1 Answers1

0

enter image description here

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()
Sharim Iqbal
  • 2,724
  • 1
  • 4
  • 24