-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtk_3.py
More file actions
22 lines (16 loc) · 698 Bytes
/
tk_3.py
File metadata and controls
22 lines (16 loc) · 698 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# -*- coding: utf-8 -*-
import Tkinter as tk
def resize(ev = None):
label.config(font = 'Helvetica -%d bold' % scale.get())
top = tk.Tk()
top.geometry('350x250')
label = tk.Label(top, text = 'hello world', font = 'Helvetica -12 bold')
label.pack(fill = tk.Y, expand = 1)
scale = tk.Scale(top, from_ = 10, to = 40, orient = tk.HORIZONTAL, command = resize)
scale.set(12)
scale.pack(fill = tk.X, expand = 1)
quit1 = tk.Button(top, text = 'QUIT', command = top.quit, activebackground = 'red', activeforeground = 'white')
quit1.pack(fill = tk.X, expand = 1)
quit2 = tk.Button(top, text = 'QUIT', command = top.quit, bg = 'blue', fg = 'white')
quit2.pack(fill = tk.X, expand = 1)
tk.mainloop()