[GH-ISSUE #595] wiki/InputField needs a tiny update #436

Closed
opened 2026-03-04 01:05:00 +03:00 by kerem · 1 comment
Owner

Originally created by @shtukas on GitHub (Apr 28, 2021).
Original GitHub issue: https://github.com/rivo/tview/issues/595

The example here: https://github.com/rivo/tview/wiki/InputField needs a tiny update because as it stands it errors with

./main.go:14:15: cannot use func literal (type func("github.com/gdamore/tcell".Key)) as type func("github.com/gdamore/tcell/v2".Key) in argument to tview.NewInputField().SetLabel("Enter a number: ").SetFieldWidth(10).SetAcceptanceFunc(tview.InputFieldInteger).SetDoneFunc

The fix is to use this import : "github.com/gdamore/tcell/v2"

Thanks :)

Originally created by @shtukas on GitHub (Apr 28, 2021). Original GitHub issue: https://github.com/rivo/tview/issues/595 The example here: https://github.com/rivo/tview/wiki/InputField needs a tiny update because as it stands it errors with ./main.go:14:15: cannot use func literal (type func("github.com/gdamore/tcell".Key)) as type func("github.com/gdamore/tcell/v2".Key) in argument to tview.NewInputField().SetLabel("Enter a number: ").SetFieldWidth(10).SetAcceptanceFunc(tview.InputFieldInteger).SetDoneFunc The fix is to use this import : "github.com/gdamore/tcell/v2" Thanks :)
kerem closed this issue 2026-03-04 01:05:00 +03:00
Author
Owner

@rivo commented on GitHub (May 28, 2021):

Thanks for the hint. I've updated this page and all the others in the Wiki (and also the gist with the PostgreSQL browser).

<!-- gh-comment-id:850479802 --> @rivo commented on GitHub (May 28, 2021): Thanks for the hint. I've updated this page and all the others in the Wiki (and also the gist with the PostgreSQL browser).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/tview#436
No description provided.