Modified BaseWidget constructor