in reply to Subroutine naming convention/style

I'd go with set_widget, because that's what the user wants to do.

I would also provide add_widget and update_widget functions for the rare cases where the user cares whether the widget previously existed or not, but, in my experience, 99% of the time, you don't care about that, you only care that, when the operation completes, the widget will be there. So I wouldn't expect them to be used nearly as often as set_widget, but they should still be there for completeness.