termui icon indicating copy to clipboard operation
termui copied to clipboard

Buttons

Open linkerlin opened this issue 7 years ago • 5 comments

Maybe we need something like buttons?

linkerlin avatar May 04 '17 02:05 linkerlin

Or input fields

jadbox avatar May 04 '17 03:05 jadbox

I started on a change for buttons, but haven't gotten too far yet. Buttons really require a notion of "focus" so that you know which button you're actually pushing both visually and through the event handler. Speaking of the event handler, there's also no way of distinguishing a "button down"/"button up" event vs. a simple key press.

pdevine avatar May 08 '17 17:05 pdevine

I did some digging and it looks like nsf/termbox-go, the library that termui uses, doesn't have any notion of "key down" and "key up", only "key pressed".

I went ahead and wrote a really simple button class which allows you to change focus between two different buttons (you hit the "tab" button to go back and forth), but really this should be a more fundamental thing where any widget can have/get focus.

screen shot 2017-05-15 at 11 47 52 am screen shot 2017-05-15 at 11 48 02 am

pdevine avatar May 15 '17 18:05 pdevine

Any update on Buttons implementation

ShardulNalegave avatar Jun 10 '20 10:06 ShardulNalegave

I would like to take this issue please

rdanielwetan avatar Oct 01 '22 04:10 rdanielwetan