rivo / tview

Terminal UI library with rich, interactive widgets — written in Golang
MIT License
11.13k stars 575 forks source link

Using widgets for simple console interaction without using entire screen, is that possible? #912

Open elsni opened 1 year ago

elsni commented 1 year ago

I would like to use widgets for fancy user interaction in small programs without using the whole screen.

like the screenshot below. The screenshot is a montage, actually the whole screen is cleared and the menu is put in the upper left corner image

(how) is it possible?

rivo commented 1 year ago

I don't think tview can be used without using the entire screen. It's based on tcell which is a library for full-screen applications.

But if you're ok with using the entire screen, you'll want to use a Pages component at the root which contains your main text (I assume it's a TextView?) and your List on top. Finding out where to place the list depends a bit on what your main component is. Again, if it's a TextView, the GetOriginalLineCount() and GetScrollOffset() functions might help.