Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class GUI:
- def __init__(self, master):
- frame = Frame(master)
- frame.pack()
- wat = BooleanVar()
- eng = BooleanVar()
- text = StringVar()
- self.inputText = Entry(frame, textvariable=text, width=25)
- self.inputText.pack(pady=5)
- self.watCheckButton = Checkbutton(frame, text="Check WAT Data?", variable=wat)
- self.watCheckButton.pack()
- self.engCheckButton = Checkbutton(frame, text="Engineering Data?", variable=eng)
- self.engCheckButton.pack()
- def execute():
- try:
- #text = self.inputText.get()
- func(text)
- print('wat is '+str(wat==True)+' eng is '+str(eng==True))
- master.destroy()
- except:
- print('problem here')
- def cancel():
- master.destroy()
- self.button = Button(frame, text="OK", command=execute, width=10)
- self.button.pack(side=LEFT,padx=5, pady=5)
- self.button = Button(frame, text="Cancel", command=cancel, width=10)
- self.button.pack(side=RIGHT,padx=5, pady=5)
- def autocapitalize(*arg):
- text.set(text.get().capitalize())
- text.trace("w", autocapitalize)
- root = Tk()
- gui = GUI(root)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment