Update for SPIN has been posted

“Igor Kovalenko” <kovalenko@home.com> wrote in message
news:99ol69$bgr$1@inn.qnx.com

“Igor Kovalenko” <> kovalenko@home.com> > wrote in message
news:99m6n3$it2$> 1@inn.qnx.com> …
“Rick Lake” <> rwlake@SPAM.REDIRECTED.TO.DEV.NULL> > wrote in message
news:> 3ABD0331.8FD91E66@SPAM.REDIRECTED.TO.DEV.NULL> …
Yes I totally agree with you. Sorry about that. In fact I was
thinking
about posting a follow-up to say that this thread should predominantly
be about thanking you for your contribution with this utility, but you
beat me to it.


In fact the way to thank me is to send postcard. So far one (1) user
managed
to do that so I’m starting to feel like QNX community must be either
very
small or very ungrateful > :wink:

Now various people told me they either have no idea what e-cards are or
somehow confused about them.

I really thought it is simple. See > http://www.e-cards.com > or
http://www.amazon.com > (click on free e-cards) or
http://greetings.yahoo.com
or whatever else. The idea is the same everywhere. You use your browser to
compose an ‘e-postcard’ by choosing a picture and adding some text. Then
it
will be formatted as HTML and sent by e-mail.

Why do I want e-cards instead of plain e-mail? I like nice pictures. And
by
choosing pictures people express themselves so I know them better than if
they just wrote something. And I’m curious > :wink:

I tend to stay away from them (as you probably have seen Igor) cause
they have banners or some sort of publicity. Next time I’ll use HTML
though;-)


  • igor

Official thanks expressed with an e-card.

Resizeing in view.c seems somewhat simplified: if
one is fast enough, one may shorten the window while it is
being filled with text. In other words, screen painting should
be interrupted, otherwise it may well go beyond the screen.
It may account for some screen effects in SPIN 1.02 in which
there may be two instances of timer_handler() at the same time,
one interrupted by SIGWINCH, but not ended, and the other called
by event_handler(). (There may be other sources of those effects.
And indeed, from my experience I’m sure the behaviour of ncurses, say,
does not always match expectations…).

In the case of SPIN, due to it’s mode of operation
(repainting screen every second), testing the screen size
at the beginnig of the loop suffice to produce similar results
(errors included, if displaying is not interrupted).

Andrzej Kocon

Igor Kovalenko wrote:

Xiaodan Tang wrote:

if someone will try to overrun that. And I’m still waiting for someone
to teach me how to handle SIGWINCH in ncurses…

Shouldn’t you get a “KEY_RESIZE” when the terminal size changed?
I could be totally wrong, but, here is a good sample:

ftp://ftp.qnx.com/usr/free/qnx4/os/libs/ncurses-4.2-bin.tgz

Or get ncurses library from anywhere, check out the little sample
called test/view.c, it showes how to catch terminal size change
(with SIGWINCH or with KEY_RESIZE).


Thanks!
I looked at the sample, it is fairly clear how to use SIGWINCH, but
KEY_RESIZE looks strange. It seems like they do nothing at all for it.
Comments just say ‘ncurses will repaint’ > :wink:

  • igor

Andrzej Kocon wrote:

Official thanks expressed with an e-card.

Nice card! I even understood most of stuff in polish :wink:

Resizeing in view.c seems somewhat simplified: if
one is fast enough, one may shorten the window while it is
being filled with text. In other words, screen painting should
be interrupted, otherwise it may well go beyond the screen.

Never seen that effect.

It may account for some screen effects in SPIN 1.02 in which
there may be two instances of timer_handler() at the same time,
one interrupted by SIGWINCH, but not ended, and the other called
by event_handler().

I see. Will try to prevent it for next release.

(There may be other sources of those effects.
And indeed, from my experience I’m sure the behaviour of ncurses, say,
does not always match expectations…).

Most of problems I’ve seen look like bogus characters here and there, 2
lines concatenated or some lines only partially drawn. For example on
some terminals the lower ‘separator’ line will be ‘cut’ slightly from
right side with some vertical window sizes. I.e., it is ok with 23
lines, cut with 24 lines, ok with 25 lines, etc. In that scenario it is
always cut on some particular vertical window size.

There are also terminals which report 25 lines but use last line for
status, that screws ncurses too (input does not work). I don’t know how
to deal with it, but specifying -R24 on command line helps.

In the case of SPIN, due to it’s mode of operation
(repainting screen every second), testing the screen size
at the beginnig of the loop suffice to produce similar results
(errors included, if displaying is not interrupted).

Andrzej Kocon

Thanks Andrzej!

  • igor