Creating and using hierarchies of widgets