-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.py
76 lines (51 loc) · 1.59 KB
/
view.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!/usr/bin/python3
# -*- coding: utf-8 -*-
from tkinter import *
from tkinter import messagebox
from setup import *
def CreateInputBoxes(window):
creds = GetCredentialsFromFile()
label = Label(window, text="Consumer Key")
label.pack()
text = Entry(window, width=25)
text.insert(0, creds[0])
text.pack()
label = Label(window, text="Consumer Secret")
label.pack()
text = Entry(window, width=25)
text.insert(0, creds[1])
text.pack()
label = Label(window, text="Access Key")
label.pack()
text = Entry(window, width=25)
text.insert(0, creds[2])
text.pack()
label = Label(window, text="Access Secret")
label.pack()
text = Entry(window, width=25)
text.insert(0, creds[3])
text.pack(pady = (0,30))
return
def CreateWindow():
window = Tk()
window.title("Settings")
window.geometry("250x400")
CreateInputBoxes(window)
def revert():
print("Reverted settings...")
def quitCommand():
window.quit()
def saveMessageBox():
res = messagebox.askyesno('Save Confirmation',
'Are you sure you want to save this configuration?')
# Do stuff here with user response
Button(window, text="Post Meme", command=quitCommand).pack()
Button(window, text="Save Settings", command=quitCommand).pack()
Button(window, text="Revert Settings", command=quitCommand).pack()
Button(window, text="Quit", command=quitCommand).pack()
window.mainloop()
return window
def Main():
window = CreateWindow()
if __name__ == "__main__":
Main()