Optimizations to InteractiveButtonBase.py.