How to modify/create widgets?

Hi everyone,

I was wondering if there’s a way to modify a widget, or to create a new one using some functions of another. Any examples, documentation or even some hints would be great.

Thanks!