Implemented widget view states and basic event functionality.