Skip to content

Instantly share code, notes, and snippets.

@aGupieWare
Created March 28, 2015 16:21
Show Gist options
  • Save aGupieWare/d99f30fcaf411985debc to your computer and use it in GitHub Desktop.
Save aGupieWare/d99f30fcaf411985debc to your computer and use it in GitHub Desktop.
PyGest Code Snippet 3-9
class View():
"""
The main view class for the PyGest tkinter interface.
"""
.
.
.
def configure_inputs(self):
"""
Configure app input objects: file path, hash value, radio buttons.
"""
logging.info("We're in the configure_inputs method")
inputs_frame = tkinter.Frame(self.mainframe, background='white', borderwidth=2, relief='flat')
inputs_frame.grid(row=1, column=0, sticky=('N', 'S', 'E', 'W'))
inputs_frame.columnconfigure(0, weight=1)
inputs_frame.columnconfigure(1, weight=1)
inputs_frame.columnconfigure(2, weight=1)
inputs_frame.rowconfigure(0, weight=1)
filepath_label = tkinter.Label(inputs_frame, text="File Name:", background="black", foreground="white")
filepath_label.grid(row=0, column=0, sticky='E')
self.file_entry = tkinter.Entry(inputs_frame)
self.file_entry.bind("<Button-1>", self.chooseFileName)
self.file_entry.grid(row=0, column=1, sticky=('E', 'W'))
self.radio_var = tkinter.StringVar()
self.radio_var.set('sha1')
sha1 = tkinter.Radiobutton(inputs_frame, text="sha1", variable=self.radio_var, value='sha1')
sha1.grid(row=0, column=2)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment