30 lines
382 B
Go
Raw Normal View History

2024-08-25 15:54:45 +12:00
package main
import (
"fmt"
"os"
2024-08-25 16:05:44 +12:00
"github.com/mappu/miqt/qt"
2024-08-25 15:54:45 +12:00
)
func main() {
2024-09-01 14:24:03 +12:00
qt.NewQApplication(os.Args)
2024-08-25 15:54:45 +12:00
btn := qt.NewQPushButton3("Hello world!")
2024-08-25 15:54:45 +12: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!")
}