-3
import tkinter as tk

class Main():

    def __init__(self, root):
        self.root = root
        self.count = 0

        frame = tk.Frame(self.root)
        frame.pack()

        btn = tk.Button(frame, text ='next number')
        btn.pack()
        btn.bind('<Button-1>', self.click)

        self.lbl = tk.Label(frame, text = 'in progress 0')
        self.lbl.pack()

    def click(self, event):
        self.count += 1
        self.lbl.config(text=f'count {self.count}')


if __name__=="__main__":
    root = tk.Tk()
    Main(root)
    root.mainloop()

how to change the font size in my program. need to change in to very large (this is a counter need to change size of the display font in both labels and button)

Bryan Oakley
  • 370,779
  • 53
  • 539
  • 685
  • Have you tried using the `tkinter.font.Font` class? – Programmer-RZ Jun 21 '23 at 08:03
  • I think this could help : https://stackoverflow.com/questions/15462647/how-to-modify-the-default-font-in-tkinter It's a bit old so you might need to update the code, but as far as I know the general logic did not change – Viper Jun 21 '23 at 08:06
  • hi programmer - rz can no . i did not can you help me to how to add it to my program please – Sachin Dunu Jun 21 '23 at 08:17
  • `Label(frame, text="in progress", font=('Times', 24))` like this. For more; https://www.tutorialspoint.com/how-to-change-the-size-of-text-on-a-label-in-tkinter – doneforaiur Jun 21 '23 at 08:48

1 Answers1

0

To change tkinter Label font size: https://www.geeksforgeeks.org/how-to-change-the-tkinter-label-font-size/

To change tkinter Button font size: https://www.tutorialkart.com/python/tkinter/button/font/#gsc.tab=0

This could have been an easy google...

Quantum
  • 510
  • 1
  • 2
  • 19