bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ripoffline() behavior with resizable windows


From: Bill Gray
Subject: ripoffline() behavior with resizable windows
Date: Fri, 29 Sep 2023 21:22:31 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1

I've been investigating how ripped-off lines work (or don't work) in PDCurses and PDCursesMod, and comparing with how ncurses does it. I'm at a point where I could probably use some advice.

In ncurses and PDCurses, ripped-off lines (at top or bottom) are drawn once, using the callback function supplied to ripoffline(). If the user resizes the screen, ncurses does "the right thing" and moves the lines ripped off at bottom so that they stay at the bottom. You can expand/contract the screen vertically and never have a problem.

Neither library ever calls the callback function again, though. So if the line was, say, 80 columns at startup, it won't get extended/contracted as the screen expands/contracts. Here's the test program I've used :

https://www.projectpluto.com/temp/ripoff.c

   Compile and run as,  for example,

./ripoff b b t

("rip off two lines at the bottom, then one at the top"), resize horizontally, and you'll see what I mean. In particular, if you shrink the window horizontally and re-expand, you lose the text in the columns you shrank over.

The SLKs (soft-label keys) _do_ get redrawn correctly under such resizing, despite SLK lines being (sort of) a subset of ripped-off lines in ncurses. (They are entirely separate beasts in PDCurses or PDCursesMod... something I intend to fix in the latter.)

It seems to me as if the callback function should be called (at least) in situations where COLS changes : in initscr( ) and whenever the screen is resized horizontally. Does this make sense to you?

-- Bill



reply via email to

[Prev in Thread] Current Thread [Next in Thread]