Improved documentation in widget.py