Skip to content

Instantly share code, notes, and snippets.

@aGupieWare
Created April 13, 2015 18:31
Show Gist options
  • Save aGupieWare/8d93fcb6738f6fca3658 to your computer and use it in GitHub Desktop.
Save aGupieWare/8d93fcb6738f6fca3658 to your computer and use it in GitHub Desktop.
PyGest Code Snippet 5-2
class View():
"""
The main view class for the PyGest tkinter interface.
"""
.
.
.
def configure_buttons(self):
"""
Configure button frame and two buttons: hash and clear.
"""
logging.info("We're in the configure buttons method.")
buttons_frame = tkinter.Frame(self.mainframe, background="blue", borderwidth=2, relief='flat')
buttons_frame.grid(row=3, column=0, sticky=('N', 'S', 'E', 'W'))
buttons_frame.columnconfigure(0, weight=1)
buttons_frame.rowconfigure(0, weight=1)
buttons_frame.rowconfigure(1, weight=1)
hash_button = tkinter.Button(buttons_frame, text='Hash', relief='raised', command=self.runHash)
hash_button.grid(row=0, column=0, sticky=('N', 'S', 'E', 'W'))
clear_button = tkinter.Button(buttons_frame, text='Clear', relief='raised', command=self.clear)
clear_button.grid(row=1, column=0, sticky=('N', 'S', 'E', 'W'))
def runHash(self):
"""
Contains functionality to run the hash function.
"""
logging.info("Hash button pressed.")
def clear(self):
"""
Clears all input and output fields.
"""
logging.info("Clear button pressed.")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment