By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,908 Members | 2,041 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,908 IT Pros & Developers. It's quick & easy.

Problem with curses: screen is blanked on second refresh

P: n/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
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.