How to create and add a custom widget?