From e9350d2a22ca896aad484db59bf4aef588caac03 Mon Sep 17 00:00:00 2001 From: Richard Horton Date: Fri, 3 Nov 2017 09:47:26 +0000 Subject: [PATCH] Created new GUI file that uses determineUserInput --- GUI2.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 GUI2.py diff --git a/GUI2.py b/GUI2.py new file mode 100644 index 0000000..8a0937c --- /dev/null +++ b/GUI2.py @@ -0,0 +1,33 @@ +import tkinter as tk +import determineUserInput as detUsrIn + +window = tk.Tk() +window.title("Chatbot Jeff") +window.geometry("600x600") +window.configure(background="cornflower blue") + +lblTitle = tk.Label(window, text="CHATBOT JEFF\n\n", bg="cornflower blue", font=(24)) +lblTitle.pack() + +userInput = tk.Entry(window) +userInput.pack() + +lbl = tk.Label(window, text="\nChatHistory", bg="cornflower blue") +lbl.pack() + +def cb(event): + userText = userInput.get() + botText = str(detUsrIn.determineUserInput(userText)[0]) + userInput.delete(0, tk.END) + msgBox.configure(state="normal") + msgBox.insert(tk.END, "User: " + userText + "\n") + msgBox.insert(tk.END, "Jeff: " + botText + "\n") + msgBox.configure(state="disabled") + return 0 + +userInput.bind("", cb) +msgBox = tk.Text(window) +msgBox.pack() +msgBox.configure(state="disabled") + +tk.mainloop()