Select DropDown widget – Fyne Golang GUI tutorial 68

Select DropDown widget – Fyne Golang GUI tutorial 68

package main
// import fyne
import (
func main() {
    // New app
    a := app.New()
    // new title and window
    w := a.NewWindow("Select entry widget, drop down")
    // resize window
    w.Resize(fyne.NewSize(400, 400))
    // lets show our selected entry in label
    label1 := widget.NewLabel("...")
    // dropdown/ select entry
    //[]string{} all our option goes in slice
    // s is the variable to get the selected value
    dd := widget.NewSelect(
        []string{"city1-dehli", "London", "islamabad", "kabul"},
        func(s string) {
            fmt.Printf("I selected %s to live forever..", s)
            label1.Text = s
    // more than one widget. so use container
    c := container.NewVBox(dd, label1)
    //show and run


[easy_media_download url=”” text=”Download Code” color=”red_darker”]

Fyne Golang GUI Course

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: