Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as t
- import tkinter.font as f
- class App:
- def __init__(self):
- root=t.Tk()
- self.customFont=f.Font(family="Helvetica", size = 12)
- buttonframe = t.Frame()
- label=t.Label(root, text="Hello, World!",f=self.customFont)
- buttonframe.pack()
- label.pack()
- bigger = t.Button(root, text="폰트를 크게", command=self.BigFont)
- smaller = t.Button(root, text="폰트를 작게", command=self.SmallFont)
- bigger.pack()
- smaller.pack()
- root.mainloop()
- def BigFont(self):
- size = self.customFont['size']
- self.customFont.configure(size=size+10)
- def SmallFont(self):
- size = self.customFont['size']
- self.customFont.configure(size=size-10)
- app=App()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement