-
Notifications
You must be signed in to change notification settings - Fork 372
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
How to handle terminal resizing? #20
Comments
There are two ways to handle it.
Which one to choose really depends on logic. In some cases you'll have a complete redraw on every event you get, then just check the size every time and it'll work. Or if your app does careful event processing and doesn't redraw itself every time, you can wait for the resize event. Yes it's not very well documented, because I'm still not sure about the right semantics of this behaviour. Perhaps I should document it better, or maybe create a tutorial of some sort explaining various aspects of termbox. Will leave that issue open as a reminder. |
To add my personal experience: I was calling |
Updated the Size() docs, is it better now? |
Yes, that looks clearer to me. Thanks! |
I've never written text-based UIs before, but I thought I'd give termbox a try since it seems pretty simple. I'm starting to get the hang of it, but one thing that's confusing me is how to handle terminal window resize events. Does termbox support this case? Ideally, I'd like to be able to define a function that runs whenever the user resizes the terminal, and the function would take care of determining the new terminal size and re-drawing cells as necessary. I don't see any documentation about this, and I don't know how easy or hard it would be.
The text was updated successfully, but these errors were encountered: