8000 Python GUI - Frames, Labels, buttons. · danjethh/programminginpython.com@6f1718e · GitHub
[go: up one dir, main page]

Skip to content

Commit 6f1718e

Browse files
author
avinash
committed
Python GUI - Frames, Labels, buttons.
1 parent cb91f58 commit 6f1718e

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed

firstGUI.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
__author__ = 'Avinash'
2+
3+
from tkinter import *
4+
5+
root = Tk()
6+
topFrame = Frame(root)
7+
topFrame.pack(side=TOP)
8+
9+
middleFrame = Frame(root)
10+
middleFrame.pack(side=RIGHT)
11+
12+
bottomFrame = Frame(root, bg="green")
13+
bottomFrame.pack(side=BOTTOM)
14+
15+
topFrame_Label = Label(topFrame, text="Welcome to Python GUI(Top Frame)")
16+
topFrame_Label.pack()
17+
18+
middleFrame_Label = Label(middleFrame, text="Welcome to Python GUI(Middle Frame)")
19+
middleFrame_Label.pack()
20+
21+
bottomFrame_Label = Label(bottomFrame, text="Welcome to Python GUI(Bottom Frame)")
22+
bottomFrame_Label.pack()
23+
theButton = Button(bottomFrame, text="Button", fg="red", bg="black")
24+
theButton.pack()
25+
root.minsize(400, 400)
26+
root.mainloop()

0 commit comments

Comments
0 (0)
0