Use attribute object to get widget class