-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpy_Appjar_gui.py
35 lines (29 loc) · 941 Bytes
/
py_Appjar_gui.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
# download appJar.zip from official site, unzip->project directory
# import the library
# appJar is the directory name
from appJar import gui
# handle button events
def press(button):
if button == "Cancel":
app.stop()
elif button == "Koala Kick":
print("Kick u!")
else:
usr = app.getEntry("Username")
pwd = app.getEntry("Password")
print("User:", usr, "Pass:", pwd)
# create a GUI variable called app
app = gui("Login Window", "400x200")
app.setBg("orange")
app.setFont(18)
# add & configure widgets - widgets get a name, to help referencing them later
app.addLabel("title", "Welcome to appJar")
app.setLabelBg("title", "blue")
app.setLabelFg("title", "orange")
app.addLabelEntry("Username")
app.addLabelSecretEntry("Password")
# link the buttons to the function called press
app.addButtons(["Submit", "Cancel", "Koala Kick"], press)
app.setFocus("Username")
# start the GUI
app.go()