How to register a widget