/
gui9.py
44 lines (34 loc) · 1.22 KB
/
gui9.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
from Tkinter import Tk, Text, BOTH, W, N, E, S
from ttk import Frame, Button, Label, Style
class Example(Frame):
def __init__(self,parent):
Frame.__init__(self,parent)
self.parent = parent
self.initUI()
def initUI(self):
self.parent.title("windows widget")
self.style = Style()
self.style.theme_use("default")
self.pack(fill= BOTH, expand=1)
self.columnconfigure(1,weight=1)
self.columnconfigure(3,pad=7)
self.rowconfigure(3,weight=1)
self.rowconfigure(5,pad=7)
lbl = Label(self, text = "Windows")
lbl.grid(sticky = W, pady=4, padx=5)
area = Text(self)
area.grid(row=1, column=0, columnspan=3, rowspan=4, padx=5, sticky = E+W+S+N)
abtn = Button(self, text="Activate")
abtn.grid(row=1, column=3)
cbtn = Button(self, text="Close")
cbtn.grid(row=2, column=3, pady=4)
hbtn = Button(self, text="Help")
hbtn.grid(row=5, column=0, padx=5)
obtn = Button(self, text = "OK")
obtn.grid(row=5, column=3)
def main():
root = Tk()
root.geometry("350x300+300+300")
app= Example(root)
root.mainloop()
main()