Add ItemSelectedCallback to MenuBar & make Menus field private
This commit is contained in:
10
main.go
10
main.go
@@ -79,10 +79,16 @@ func main() {
|
||||
|
||||
var fileSelector *ui.FileSelectorDialog // if nil, we don't draw it
|
||||
|
||||
bar := ui.NewMenuBar(&theme)
|
||||
|
||||
barFocused := false
|
||||
|
||||
bar := ui.NewMenuBar(&theme)
|
||||
bar.ItemSelectedCallback = func() {
|
||||
// When something is selected in the MenuBar,
|
||||
// we change focus back to the tab container.
|
||||
changeFocus(tabContainer)
|
||||
barFocused = false
|
||||
}
|
||||
|
||||
fileMenu := ui.NewMenu("_File", &theme)
|
||||
|
||||
fileMenu.AddItems([]ui.Item{&ui.ItemEntry{Name: "_New File", Callback: func() {
|
||||
|
Reference in New Issue
Block a user