Start with this tutorial to learn how to add a widget extension. Follow this one to modify the widget to be what you need.