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

Add a function for resizing a Window #65

Merged
merged 2 commits into from
Sep 29, 2021
Merged

Conversation

vainiovano
Copy link
Contributor

It is possible to resize the terminal but it is boring without being able to manually resize a window.

Pancurses doesn't contain a wrapper for wresize so I decided to add it.
I forgot to change lines into nlines and cols into ncols in the function call
@vainiovano vainiovano changed the title Add a function for resizing a window Add a function for resizing a Window Apr 14, 2019
@jeff-hughes
Copy link

Hi, is there any update about this PR? I am using pancurses to develop an app with two windows that should each take up half the screen. Right now there is currently no way to resize the windows to maintain them at half the screen when the terminal is resized. Implementing wresize() would be extremely helpful here, instead of having to copy them into new windows and delete the originals.

@vainiovano
Copy link
Contributor Author

The development speed of this library seems to be quite slow. I haven't used pancurses for a long time.

@cbiffle
Copy link

cbiffle commented Oct 10, 2020

@vainiovano can you suggest an alternative? Cursive seems like overkill for what I'm doing...

@jeff-hughes
Copy link

@cbiffle I don't know whether @vainiovano found another solution, but the one I used in the end was to literally just destroy the window and recreate it every time it's resized (see here). It's not an elegant solution, but it works and surprisingly doesn't lead to any noticeable slowdown. I just look for the Input::KeyResize input and then recreate the window with the new size.

But it would still definitely be nice to have the wresize() function implemented.

@vainiovano
Copy link
Contributor Author

Cursive seems to only use one window. Its KeyResize handling for pancurses is here. If you need multiple windows, you can recreate them on resize like @jeff-hughes said.

@ihalila
Copy link
Owner

ihalila commented Sep 29, 2021

Thanks for the PR!

@ihalila ihalila merged commit eab281e into ihalila:master Sep 29, 2021
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 this pull request may close these issues.

4 participants