Open yesnault opened 9 years ago
I think for now you have to do:
Input
widget is planed but we are not getting there yet, since there is an undergoing refactoring and only after this I will switch to the event system and new widgets :)
+1
I've got a basic implementation of a termui-based editbox working in https://github.com/mikepea/go-jira-ui
It's basically a port of the EditBox example code from termbox-go.
It's not in a state where it'd be contributable upstream (yet), but it'd be a reasonable base to use in your own projects. See ui_controls.go for how it's connected to the keyboard event handler.
yeah.I need this feature too.it's not easy to get the input text string in termui.
Any info of if this is still in the roadmap or not? I think this is a pretty essential feature.
I am also waiting for this basic feature.
hi all,I have solved this problem. https://github.com/liushuchun/wechatcmd
Hi all,
I have created a basic input component for termui, you can see it in my fork here: https://github.com/SAPessi/termui/commit/71d140f624b87461a4ed362e55fc2d1c13c0c7a4
You can use it like this:
// first param is the string content, the second whether it should be multi-line or not
input := termui.NewInput("", true)
input.Height = termui.TermHeight()
input.BorderFg = termui.ColorYellow
// same properties as other Block
termui.Render(input)
// the StartCapture method tells the editor to begin listening for /sys/kbd events
input.StartCapture()
@gizak interested in a pull request?
Update Made a few changes since the original commit, take a look at the file here: https://github.com/SAPessi/termui/blob/master/input.go
Also working on a dropdown component
@SAPessi Hi pull requests are very welcome!
Sent as pull requests #129
Hi all,
I have created a basic input component for termui, you can see it in my fork here: sapessi@71d140f
You can use it like this:
// first param is the string content, the second whether it should be multi-line or not input := termui.NewInput("", true) input.Height = termui.TermHeight() input.BorderFg = termui.ColorYellow // same properties as other Block termui.Render(input) // the StartCapture method tells the editor to begin listening for /sys/kbd events input.StartCapture()
@gizak interested in a pull request?
Update Made a few changes since the original commit, take a look at the file here: https://github.com/SAPessi/termui/blob/master/input.go
Also working on a dropdown component
Excuse me, I use go version 12.9 on Windows 10. I put "input.go" in "$GOPATH\src\gopkg.in\gizak\termui.v2" and ran the example you offered. However, it occurred fatal error. I've posted the problem here.
Thank you very much! Max
Hi,
Is there an easy way to make an edit box with termui ?
Tks,