measure a widget