Closed rythmkraze closed 5 years ago
Yes, cgo does not support calling variadic C functions.
In some cases, where the variadic arguments are to support printf-like functionality, gobbi does provide support. It does this by using fmt.Sprintf
to format a string from the arguments, and then calls the C function with the formatted string. However it gets trickier for other types of function.
In many cases there are alternative functions that can be used. And I think that gtk_text_buffer_create_tag
is one such case.
Something like this will probably work.
tag := gtk.TextTagNew("my_tag_name")
editable := gobject.ValueNew(gobject.TYPE_BOOLEAN)
editable.SetBoolean(false)
tag.Object().SetProperty("property-name", editable)
indent := gobject.ValueNew(gobject.TYPE_INT)
indent.SetInt(4)
tag.Object().SetProperty("indent", indent)
tagTable := gtk.TextTagTableNew()
tagTable.Add(tag)
buffer := gtk.TextBufferNew(tagTable)
I'll see about writing a documentation page describing this sort of problem and workaround.
Thanks for the workaround.
https://pekim.github.io/gobbi/variadic-functions/ now contains some general notes about variadic function support in gobbi.
ec4437f7
gtk_text_buffer_create_tag() is missing from the api. Is this unimplemented because of varargs?