optimization and lazy construction of popup menu in labelBox.py