mirror of
https://github.com/VladimirMarkelov/clui.git
synced 2025-04-28 13:48:50 +08:00
parent
5d3a40175d
commit
efca4aaa22
14
dialog.go
14
dialog.go
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
2
edit.go
2
edit.go
@ -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)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user