Introduced event handling. Improved grid widget.