B4X:
Private Sub Msgbox_Click(ButtonText As String)
bCallSubUtils.WithAppExit3_IfSubNotExistsX("clsB_Msgbox3", "Msgbox_Click", "CallbackModule", Subname, CallbackModule, ButtonText, UserData, True)
' CallSubDelayed3(CallbackModule, Subname, ButtonText, UserData)
End Sub
With CallSubDelayed3 ... wait for (sender) works.
With bCallSubUtils.WithAppExit3_IfSubNotExistsX wait for (sender) doesn't work.
With bCallSubUtils.WithAppExit3_IfSubNotExistsX wait for without (sender) works.
bCallSubUtils - helper code module with sub wrappers for callsub/callsubdelayed routines.