Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

usage question #25

Open
edk opened this issue Oct 4, 2023 · 1 comment · May be fixed by #26
Open

usage question #25

edk opened this issue Oct 4, 2023 · 1 comment · May be fixed by #26

Comments

@edk
Copy link

edk commented Oct 4, 2023

Hi, thanks for the library!

I was looking for something easier to use than curses, but more control than (the awesome) TTY libraries, and so far, this looks very promising!

I've been playing around with it, and am enjoying the combination of simplicity and effectiveness so far, it really works! :) Thank you for the library. A couple of questions/requests:

  • I was wondering if you had any examples or docs on how to do multiple viewports on the screen at once, if that's a possible way to use it? e.g. a split pane interface. The Size still has me confused. can I specify an area with that? My random jabs at it have been unsuccessful so far.
  • How would you do a "popup modal"? I tried using a new viewport, and an existing viewport with a different Partial, and those cleared the screen. I'd like to have the existing viewport below, and when the modal is done, be able to restore the dirty areas.

Thanks!

@acook
Copy link
Owner

acook commented Oct 7, 2023

Hi, I too wanted something kind of in the middle without any binary dependencies.

A Viewport is the library's internal model of the terminal. It is directly connected to the output of the terminal and clears the terminal whenever it redraws, so there can really only be one active at a time. Instead the intention was to swap them out or change the Views or Partials that the Viewport uses.

There isn't yet a split screen helper, instead you could pull the console size and generate content which pads out the left side content before merging them.

I am working on a set of more advanced functionality which can do a lot more with multiple frames and layers, but it is a work in progress. Feel free to check it out and even work on it with me.

@acook acook linked a pull request Dec 18, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants