You can set all the parameters (except frame) in the call to create a ui object.

Like button here https://forum.omz-software.com/topic/6826/ui-button-action-parameters/29