#82 #78 - do not run callbacks in separate thread

This commit is contained in:
Vladimir Markelov 2018-01-27 14:21:28 -08:00
parent 5d3a40175d
commit efca4aaa22
3 changed files with 10 additions and 10 deletions

View File

@ -77,7 +77,7 @@ func CreateConfirmationDialog(title, question string, buttons []string, defaultB
closeFunc := dlg.onClose
WindowManager().EndUpdate()
if closeFunc != nil {
go closeFunc()
closeFunc()
}
})
var btn2, btn3 *Button
@ -89,7 +89,7 @@ func CreateConfirmationDialog(title, question string, buttons []string, defaultB
dlg.result = DialogButton2
WindowManager().DestroyWindow(dlg.view)
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
})
}
@ -100,7 +100,7 @@ func CreateConfirmationDialog(title, question string, buttons []string, defaultB
dlg.result = DialogButton3
WindowManager().DestroyWindow(dlg.view)
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
})
}
@ -122,7 +122,7 @@ func CreateConfirmationDialog(title, question string, buttons []string, defaultB
WindowManager().DestroyWindow(dlg.view)
}
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
}
return true
@ -212,7 +212,7 @@ func CreateSelectDialog(title string, items []string, selectedItem int, typ Sele
}
WindowManager().DestroyWindow(dlg.view)
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
})
@ -223,7 +223,7 @@ func CreateSelectDialog(title string, items []string, selectedItem int, typ Sele
dlg.value = -1
WindowManager().DestroyWindow(dlg.view)
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
})
ActivateControl(dlg.view, btn2)
@ -236,7 +236,7 @@ func CreateSelectDialog(title string, items []string, selectedItem int, typ Sele
WindowManager().DestroyWindow(dlg.view)
}
if dlg.onClose != nil {
go dlg.onClose()
dlg.onClose()
}
}

View File

@ -25,7 +25,7 @@ func (e *EditField) SetTitle(title string) {
e.title = title
if e.onChange != nil {
ev := Event{Msg: title}
go e.onChange(ev)
e.onChange(ev)
}
}
}

View File

@ -258,7 +258,7 @@ func (l *ListBox) processMouseClick(ev Event) bool {
WindowManager().EndUpdate()
if onSelFunc != nil {
ev := Event{Y: l.topLine + dy, Msg: l.SelectedItemText()}
go onSelFunc(ev)
onSelFunc(ev)
}
return true
@ -316,7 +316,7 @@ func (l *ListBox) ProcessEvent(event Event) bool {
case term.KeyCtrlM:
if l.currSelection != -1 && l.onSelectItem != nil {
ev := Event{Y: l.currSelection, Msg: l.SelectedItemText()}
go l.onSelectItem(ev)
l.onSelectItem(ev)
}
default:
return false