andlabs / ui

Platform-native GUI library for Go.
Other
8.33k stars 651 forks source link

how to select a folder #260

Closed bean-du closed 6 years ago

bean-du commented 6 years ago

I can't select a folder use ui.OPenFile, please help me this is my code

func initUI()  {
    b := ui.NewButton("选择文件")
    w := ui.NewWindow("选择文件",300,300,false)
    b.OnClicked(func(button *ui.Button) {
        s := ui.OpenFile(w)
        fmt.Println(s)
    })
    window := ui.NewWindow("Hello", 200, 100, false)
    window.SetMargined(true)
    window.SetChild(b)
    window.Show()
}

func main() {
    err := ui.Main(initUI)
    if err != nil {
        panic(err)
    }
}
andlabs commented 6 years ago

I have not added that functionality yet; it is planned once I figure out the best way to implement dialog boxes due to OS-specific quirks that even the current implementation falls subject to.

andlabs commented 6 years ago

Replaced with andlabs/libui#314.

zhaoguotao commented 5 years ago

OpenFolder added?