How to add a widget to the post editing view?

“Widgets” as you’re calling them on the post edit screen are actually meta boxes. You can add as many as you want to do whatever you want using the add_meta_box() function.

Once you know what they’re called, it’s fairly straight-forward to do a Google search for examples. Or check out some great tutorials listed in the Codex.