implement widget API.
a basic struct