PDCurses
PDCurses copied to clipboard
ncurses compatibility: allow newwin off-screen
This came up in #57 first, as it is a completely different issue with some effort to put in it is tracked here.
Initial finding of @tysenmoore-xse, documented in his repo:
... better handle windows that are out of the screen size. PDCurses will not allocate the window [...] ncurses appears to allocate the window just fine.
@wmcbrine commented:
Yeah, I noticed the oversized window thing a while back. I was actually surprised that ncurses does that, but, emulating it is probably the right thing. and: Clipping is not contemplated. Working like ncurses means returning the requested size, even if parts of it are off-screen.
with the additional notes of @Bill-Gray:
[...]
newwincould do no clipping nor checking, and would allocate the entire window; it's just that there would be parts of that window you couldn't see (unless the window was moved). That would require a fair bit of change elsewhere, I think, inasmuch as we'd have to have logic that said : 'use this part of the window, but only the parts that actually land on the screen." At present, you can move windows, but you can't move parts of them off-screen. and: I just did some experimenting withnewwinin ncurses, and found that it does have that limitation. You can callnewwinwith the x and y coordinates for the upper left corner to put the window partly off-screen to the right or bottom, but negative values for x or y fail. I'd argue that ncurses has it wrong. If you're going to allow windows to go off the right or bottom edge, then the top and left edges should be fair game.