Minor cleanup of the code I copied and pasted from pydaw_widgets.py