Problem with curses: screen is blanked on second refresh

A

AK

Hi,

I have a medium sized app that I'm transferring to use curses.

What happens is very very strange.. I am at my wits' ends. I worked
with it all day yesterday and couldn't figure it out. Today morning I
thought about it and still nothing. I hope that some curses expert can
figure out what's wrong from my description. I'm very new to curses so
I am not sure I know which details are crucial, so please answer me if
you need more details.

I have a function that uses win.addnstr() calls to add strings to the
win (which is passed by curses.wrapper). First time the function is
called, it works just fine. Second time it makes the screen blank and
the only things that show up are single digits that are updated by
another thread. The x coord given to the addnstr() is always 0.

That thread should print a line with elapsed time, full time, and a
short string of text; it should print on the bottom line on screen.
First time it's called it does just that; all other times it prints
only the digits of the elapsed time that are different from what was
already there, and it blanks the rest of the line; and it prints it on
*top* line of screen.

If I call win.clear() at the top of the main redraw function, it works
fine. Full screen is updated and shown. The only problem is that it
flickers while updating. It flickers once but it's annoying enough - I
hope to only update spots on screen that really changed.

If I call win.redrawwin() instead of win.clear(), the lines that
changed are updated and shown, but *all other lines are blanked*.

And if I call neither win.clear() nor redrawwin(), the whole screen is
blanked on second redraw, and as I said only single digits changing
show up at the top of screen instead of bottom.

Things I tried: I passed the same string 'TEST', to all lines. They
show up fine on first refresh, then disappear. So this is not about
the strings I pass.

I have other threads updating the screen, but even if I disable all of
them, I get the same strange behaviour.

Hope you can advise me.. thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top