Disable "Send it" button

This commit is contained in:
raul 2024-05-06 13:34:29 +02:00
parent c63028dea0
commit f8332d102a
1 changed files with 13 additions and 13 deletions

View File

@ -159,9 +159,9 @@ func initKeybindings(g *gocui.Gui) error {
log.Panicln(err)
}
if err := g.SetKeybinding("button", gocui.MouseLeft, gocui.ModNone, sendToServer); err != nil {
log.Panicln(err)
}
// if err := g.SetKeybinding("button", gocui.MouseLeft, gocui.ModNone, sendToServer); err != nil {
// log.Panicln(err)
// }
if err := g.SetKeybinding("textarea", gocui.KeyEnter, gocui.ModNone, sendToServer); err != nil {
log.Panicln(err)
@ -197,17 +197,17 @@ func layout(g *gocui.Gui) error {
chatbox.Title = "Chat Box"
}
if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX-28, maxY-2); err != nil {
if err != gocui.ErrUnknownView {
return err
}
// if button, err := g.SetView("button", maxX/2+32, maxY-4, maxX-28, maxY-2); err != nil {
// if err != gocui.ErrUnknownView {
// return err
// }
//
// button.Wrap = true
// button.Frame = true
// fmt.Fprintln(button, "Send it")
// }
button.Wrap = true
button.Frame = true
fmt.Fprintln(button, "Send it")
}
if textarea, err := g.SetView("textarea", 2, maxY-4, maxX-40, maxY-2); err != nil {
if textarea, err := g.SetView("textarea", 2, maxY-4, maxX-28, maxY-2); err != nil {
if err != gocui.ErrUnknownView {
return err
}