Use the Factory design pattern to instanciate widgets