-
Notifications
You must be signed in to change notification settings - Fork 1
/
gui2.py
47 lines (33 loc) · 1.08 KB
/
gui2.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
45
46
47
from tkinter import Tk, RIGHT, BOTH, RAISED, TOP, LEFT, NE
from tkinter.ttk import Frame, Button, Style
import top as top
class Example(Frame):
window = ""
def __init__(self, window):
super().__init__()
self.window = window
self.initUI()
def initUI(self):
self.master.title("Buttons")
self.style = Style()
self.style.theme_use("default")
frame = Frame(self, relief=RAISED, borderwidth=1)
frame.pack(fill=BOTH, expand=True)
self.pack(fill=BOTH, expand=True)
closeButton = Button(self, text="Close", command=self.window.destroy)
closeButton.pack(side=RIGHT, padx=5, pady=5)
okButton = Button(self, text="OK")
okButton.pack(side=RIGHT)
def main():
root = Tk()
root.geometry("700x500")
btn1 = Button(master=root, text='Process')
btn1.pack(padx=5, pady=5)
btn2 = Button(master=root, text='CPU')
btn2.pack()
btn3 = Button(master=root, text='File System')
btn3.pack()
app = Example(root)
root.mainloop()
if __name__ == '__main__':
main()