Looking at the docs for GObject, it appears that all init are simple wrappers around the C constructors, except for its most convenient one, the variadic g_object_new function. The closest match seems to be GLibObject.Object.new, which takes a GType, but unfortunately no property arguments. The remaining init all appear to take UnsafeMutablePointer to C strings or GValue which are pretty inconvenient to use from Swift.
Python solves this by taking keyword arguments and passing those as the properties. I don't think that that would be possible in Swift's form of variadic arguments.
Lua solves this by taking a table as first argument with property name/values. I guess that might work for Swift by taking a [String: Any].
Looking at the docs for
GObject, it appears that allinitare simple wrappers around the C constructors, except for its most convenient one, the variadicg_object_newfunction. The closest match seems to beGLibObject.Object.new, which takes aGType, but unfortunately no property arguments. The remaininginitall appear to takeUnsafeMutablePointerto C strings orGValuewhich are pretty inconvenient to use from Swift.Python solves this by taking keyword arguments and passing those as the properties. I don't think that that would be possible in Swift's form of variadic arguments.
Lua solves this by taking a table as first argument with property name/values. I guess that might work for Swift by taking a
[String: Any].