Skip to content

Instantly share code, notes, and snippets.

@aGupieWare
Created March 28, 2015 15:54
Show Gist options
  • Select an option

  • Save aGupieWare/298959923ce719d094b5 to your computer and use it in GitHub Desktop.

Select an option

Save aGupieWare/298959923ce719d094b5 to your computer and use it in GitHub Desktop.
PyGest Code Snippet 3-4
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.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'))
def chooseFileName(self, event):
"""
Controls file path pop up dialog on click of entry field.
"""
logging.info("Choose File Name method called.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment