Dear Tomas,
Thank you for this bindings! This is super useful.
I have a little experience in Vala, but on trying to use some elements from gtk I get errors. Specifically I am trying to use headerbars. How do this class translates into Swift? What am I doing wrong in the code below?
import SwiftGtk
let app = Application(applicationId: "com.example.application")
app.run { window in
window.defaultSize = Size(width: 400, height: 400)
window.resizable = true
let headerbar = Headerbar()
headerbar.set_title("My test")
let button = Button(label: "Press Me")
button.clicked = { _ in
let newWindow = Window(windowType: .topLevel)
newWindow.title = "Just a window"
newWindow.defaultSize = Size(width: 200, height: 200)
let labelPressed = Label(text: "Oh, you pressed the button.")
newWindow.add(labelPressed)
newWindow.showAll()
}
window.set_titlebar(headerbar)
window.add(button)
}
Dear Tomas,
Thank you for this bindings! This is super useful.
I have a little experience in Vala, but on trying to use some elements from gtk I get errors. Specifically I am trying to use headerbars. How do this class translates into Swift? What am I doing wrong in the code below?