Fyne GoLang GUI Course checkbox – Tutorial 5

class 5 fyne GoLang GUI checkbox

package main
// importing fyne
import (
"fmt"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/widget"
)
func main() {
// New App
a := app.New()
// New Window and title
w := a.NewWindow("Here is check box tutorial title")
// Resizing window of App
w.Resize(fyne.NewSize(400, 400))
// check box widget
checkbox1 := widget.NewCheck("Male", func(b bool) {
if b == true {
fmt.Println("Male")
} else {
fmt.Println("Not Male")
}
})
// set up content
w.SetContent(checkbox1)
// running and showing app
w.ShowAndRun()
}

 

Download Code

 

Tony BB
 

TonyBB is a Coach , marketer, hypnotist and a founder of RSKVF Production who specializes in providing simple, affordable, and easy to use solutions for Life.

Click Here to Leave a Comment Below 0 comments

Leave a Reply: