Closed Elara6331 closed 4 years ago
Documentation is now available at https://rhx.github.io/SwiftGtk
Also, while there are no Swift-specific tutorials, there are a number of example projects (see the README). Also if you look at gtk tutorials for other languages, you can often translate this to the (auto-generated) Swift version fairly easily. For example, gtk_label_new(str)
translates to an auto-generated constructor init(str: String)
in Swift. So what you want can be achieved by something like:
let label = Label(str: "Text")
window.add(widget: label)
You can try this by adding the above code to the SwiftHelloGtk example, right before window.showAll()
.
I would like something like Label(text: "") to add a label into an app as right now, there is no easy way of doing it that I found. Also, you should have documentation on this, it is very confusing when I have to go through the source code trying to find out how to make something work. Thank you.