-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain Loop.py
More file actions
69 lines (48 loc) · 1.87 KB
/
Main Loop.py
File metadata and controls
69 lines (48 loc) · 1.87 KB
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
__author__ = 'Alex Corkin'
from Tkinter import *
import webbrowser
personalWebsite = "http://4lex.nz"
linkedIn = "http://nz.linkedin.com/in/alexcorkin"
def OpenUrl(desiredUrl):
webbrowser.open_new(desiredUrl)
def placeholderFunction():
filewin = Toplevel(mainWindow)
button = Button(filewin, text="Do nothing button")
button.pack()
def showScrambleView():
inputMessageLabel = Label(mainWindow, text="Enter the message to be scrambled")
inputMessageLabel.pack()
inputMessageEntry = Entry(mainWindow)
inputMessageEntry.pack()
showUnscrambleView.outputMessageLabel.pack_forget()
showUnscrambleView.outputMessageEntry.pack_forget()
def showUnscrambleView():
outputMessageLabel = Label(mainWindow, text="This is your scrambled message:")
outputMessageLabel.pack()
outputMessageText = Text(mainWindow)
outputMessageText.insert(INSERT, "Test Text")
outputMessageText.pack()
showScrambleView.inputMessageLabel.pack_forget()
showScrambleView.inputMessageEntry.pack_forget()
# Render GUI
mainWindow = Tk()
# Widgets
# Program Title
programTitle = StringVar()
programTitle.set("Simple Cipher Program")
titleWidget = Label(mainWindow, textvariable=programTitle)
# User Action Radio Button
radioController = IntVar()
scramblerRadio = Radiobutton(mainWindow, text='Scramble a message', variable=radioController, value=1,
command=showScrambleView)
unscrambleRadio = Radiobutton(mainWindow, text='Unscramble a message', variable=radioController, value=2,
command=showUnscrambleView)
# Draws the window on screen complete with widgets
mainWindow.minsize(800, 600)
mainWindow.geometry('800x600-50+50')
titleWidget.pack()
scramblerRadio.pack()
unscrambleRadio.pack()
mainWindow.mainloop()
#Encrypt Message --> Pass details to Encryption.py
#Display Result --> Recieve and Display message