mojbro / gocoa

Go bindings for the Cocoa framework to build macOS applications
MIT License
68 stars 17 forks source link

Implement ComboBox #20

Closed StarHack closed 3 years ago

StarHack commented 3 years ago

Adds support for a ComboBox component

example-combobox

combobox := gocoa.NewComboBox(25, 125, 150, 25)
combobox.AddItem("hello")
combobox.AddItem("world")
combobox.SetSelectedIndex(0)
combobox.SetEditable(false)
combobox.OnSelectionDidChange(func() {
    fmt.Println(combobox.SelectedText())
    fmt.Println(combobox.SelectedIndex())
})
wnd.AddComboBox(combobox)
mojbro commented 3 years ago

Looks great!!

ack3rs commented 3 years ago

Love it!