miqt/examples/helloworld/main.go

31 lines
398 B
Go
Raw Normal View History

2024-08-25 03:54:45 +00:00
package main
import (
"fmt"
"os"
2024-08-25 04:05:44 +00:00
"github.com/mappu/miqt/qt"
2024-08-25 03:54:45 +00:00
)
func main() {
app := qt.NewQApplication(os.Args)
_ = app
btn := qt.NewQPushButton2("Hello world!")
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!")
}