Alternative to multiple if statements
I don't see any simple way to generalize your if statements, since they result in very different actions. You might be able to push that complexity into the widgetType instead, if that code is under your control, but it won't reduce the total amount of code.

What concerns me, though, is the length of the parameter list: 10 parameters, of which 9 are mandatory.  The caller is certainly going to look ugly.  A quick improvement might be to accept keyword arguments.  A deeper analysis might reveal that those parameters should belong in an object instead.