[go-nuts] Re: How to scan input with termui?

2020-05-05 Thread 洪嘉鴻
I've tried the links you offered and test the source code . However, it occurred fatal error. I have no idea what causes the problem. The error is as the following picture. [image: Error.PNG] Thank you very much! Max Brian Candler於 2020年4月17日星期五 UTC+8下午

[go-nuts] Re: How to scan input with termui?

2020-04-19 Thread 洪嘉鴻
I've seen the hits you offered. However, I couldn't see any examples with the hits. Besides, the version of termui I used is v3, which is the latest version. There isn't any functions about the input. The second is that I want to print something as normal after exit the UI. Thanks for your replyin

[go-nuts] Re: How to scan input with termui?

2020-04-17 Thread Brian Candler
Well, it's always good to fix the errors :-) In short, you'll need to get a string from termui, and then use fmt.Sscanf instead of fmt.Scanf. A quick google for "go termui text input" turns up these as the first two hits: https://github.com/gizak/termui/issues/34 https://github.com/gizak/termui

[go-nuts] Re: How to scan input with termui?

2020-04-17 Thread 洪嘉鴻
I think that you misunderstand my meaning. The input I wondered is from the keyboards, like this . I have no idea how to implement it with termui. Besides, I edit the code to print something after closing the UI. Howev

[go-nuts] Re: How to scan input with termui?

2020-04-16 Thread Brian Candler
inputParagraph.Text = fmt.Scanf("%s", input) // Error: assignment mismatch: 1 variable but fmt.Scanf returns 2 values The error message is clear: fmt.Scanf returns two values (BTW, neither of them is the value extracted). Check the documentation for fmt.Scanf here: https://golang.org/pkg/fmt/#