gizak / termui

Golang terminal dashboard
MIT License
13.11k stars 786 forks source link

Buttons #144

Open linkerlin opened 7 years ago

linkerlin commented 7 years ago

Maybe we need something like buttons?

jadbox commented 7 years ago

Or input fields

pdevine commented 7 years ago

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 commented 7 years ago

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
ShardulNalegave commented 4 years ago

Any update on Buttons implementation

rdanielwetan commented 1 year ago

I would like to take this issue please