tricrypt/tui/util.go

29 lines
717 B
Go
Raw Normal View History

2024-05-01 16:21:10 +02:00
package tui
import "git.qowevisa.me/Qowevisa/gotell/errors"
func (t *TUI) SendMessageToServer(title string, minW int) {
var msg []rune
h, d := SendMessageToConnectionEasy(&msg)
err := t.addWidget(widgetConfig{
Input: &msg,
Title: title,
MinWidth: minW,
HasBorder: true,
WidgetPosConfig: widgetPosGeneralCenter,
CursorPosConfig: cursorPosGeneralCenter,
DataHandler: h,
Data: d,
Next: nil,
Finale: nil,
})
if err != nil {
t.errorsChannel <- errors.WrapErr("t.addWidget", err)
}
err = t.drawSelectedWidget()
if err != nil {
t.errorsChannel <- errors.WrapErr("t.drawSelectedWidget", err)
}
2024-05-25 08:19:41 +02:00
t.readInputState <- true
2024-05-01 16:21:10 +02:00
}