Skip to content

Commit 5277e2e

Browse files
author
tuntun
committed
一个超简单windows窗口图形界面
1 parent 8b00595 commit 5277e2e

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

Diff for: window.py

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
from tkinter import *
2+
3+
root = Tk()
4+
frame = Frame(root)
5+
frame.pack()
6+
7+
var = StringVar()
8+
label = Label( root, textvariable=var, relief=RAISED )
9+
10+
var.set("Hey!? How are you doing?")
11+
label.pack(side = TOP)
12+
13+
bottomframe = Frame(root)
14+
bottomframe.pack( side = BOTTOM )
15+
16+
redbutton = Button(frame, text="Red", fg="red")
17+
redbutton.pack( side = LEFT)
18+
19+
greenbutton = Button(frame, text="Brown", fg="brown")
20+
greenbutton.pack( side = LEFT )
21+
22+
bluebutton = Button(frame, text="Blue", fg="blue")
23+
bluebutton.pack( side = LEFT )
24+
25+
blackbutton = Button(bottomframe, text="Black", fg="black")
26+
blackbutton.pack( side = BOTTOM)
27+
28+
root.mainloop()

0 commit comments

Comments
 (0)