-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfirstGUI.py
More file actions
36 lines (27 loc) · 794 Bytes
/
Copy pathfirstGUI.py
File metadata and controls
36 lines (27 loc) · 794 Bytes
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
from tkinter import *
# buat root windows
root = Tk()
# buat judul windows dan dimensi
root.title("First Project")
root.geometry('350x200')
# buat menu bar pada root windows
# item baru di menu bar dan melabelinya dengan 'new'
# buat item tambahan di menu bar
menu = Menu(root)
item = Menu(menu)
item.add_command(label='New')
menu.add_cascade(label='File', menu=item)
root.config(menu=menu)
# buat label untuk root windows
lbl = Label(root, text= "Kamu itu siapa ?")
lbl.grid()
# buat field input
txt = Entry(root, width=10)
txt.grid(column =1, row=0)
def clicked():
res = "Kamu Tulis" + txt.get()
lbl.configure(text = res)
# buttom widget dengan text warna merah disamping
btn = Button(root, text="Start", fg = "red", command=clicked)
btn.grid(column=2, row=0)
root.mainloop()