napperley
01/06/2020, 1:33 AMWhen calling variadic C functions spread operator is supported only for *arrayOf(...) . Looking at defining a function which takes a fixed number of parameters at the end (which is ungainly but it compiles), eg:
fun addMultipleButtons(
firstButtonText: String,
responseId1: Int,
responseId2: Int,
responseId3: Int = 0,
responseId4: Int = 0,
responseId5: Int = 0
) {
gtk_info_bar_add_buttons(
info_bar = gtkInfoBarPtr,
first_button_text = firstButtonText,
variadicArguments = *arrayOf(responseId1, responseId2, responseId3, responseId4, responseId5, null)
)
}