bug-ncurses
[Top][All Lists]
Advanced

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

Re: ripoffline() behavior with resizable windows


From: Thomas Dickey
Subject: Re: ripoffline() behavior with resizable windows
Date: Mon, 2 Oct 2023 04:08:58 -0400

On Fri, Sep 29, 2023 at 09:22:31PM -0400, Bill Gray wrote:
>    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 :

but the documentation for ripoffline doesn't directly mention soft-keys,
and is explicit that it's called only once.  Likely there are programs
that rely upon this arrangement.
 
> 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.

I don't see any text lost (in xterm, of course).  It is repainted.
 
>    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?

perhaps as a new function, but not really for the existing function.

-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

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