miqt/examples/helloworld6/main.go

30 lines
386 B
Go
Raw Normal View History

2024-10-20 05:38:54 +00:00
package main
import (
"fmt"
"os"
qt "github.com/mappu/miqt/qt6"
)
func main() {
qt.NewQApplication(os.Args)
btn := qt.NewQPushButton3("Hello world!")
2024-10-20 05:38:54 +00:00
btn.SetFixedWidth(320)
var counter int = 0
btn.OnPressed(func() {
counter++
btn.SetText(fmt.Sprintf("You have clicked the button %d time(s)", counter))
})
btn.Show()
qt.QApplication_Exec()
fmt.Println("OK!")
}