Advertisement
Guest User

`123333333333333333333

a guest
Jun 20th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. import tkinter as t
  2. import tkinter.font as f
  3.  
  4. class App:
  5. def __init__(self):
  6. root=t.Tk()
  7.  
  8. self.customFont=f.Font(family="Helvetica", size = 12)
  9.  
  10. buttonframe = t.Frame()
  11. label=t.Label(root, text="Hello, World!",f=self.customFont)
  12. buttonframe.pack()
  13. label.pack()
  14.  
  15. bigger = t.Button(root, text="폰트를 크게", command=self.BigFont)
  16. smaller = t.Button(root, text="폰트를 작게", command=self.SmallFont)
  17. bigger.pack()
  18. smaller.pack()
  19. root.mainloop()
  20. def BigFont(self):
  21. size = self.customFont['size']
  22. self.customFont.configure(size=size+10)
  23.  
  24. def SmallFont(self):
  25. size = self.customFont['size']
  26. self.customFont.configure(size=size-10)
  27.  
  28. app=App()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement