473,765 Members | 1,963 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem with curses: screen is blanked on second refresh

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
0 1842

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
392
by: AK | last post by:
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...
0
1413
by: Casey Bralla | last post by:
For some reason, I can't get curses to refresh the screen. Can someone offer a suggestion to try to debug this? Here is my python code snippet: stdscr=curses.initscr() curses.noecho() curses.cbreak() stdscr.keypad(1) global screen
30
6116
by: Ian Ward | last post by:
When I run the following code in a terminal with the encoding set to UTF-8 I get garbage on the first line, but the correct output on the second. import curses s = curses.initscr() s.addstr('\xc3\x85 U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE\n') s.addstr('\xc3\xa5 U+00F5 LATIN SMALL LETTER O WITH TILDE') s.refresh() s.getstr()
0
1036
by: mike.baranski | last post by:
So, can someone tell me why the following code is wrong? When you run it, it will place a . as you arrow key around the screen. Everything works, until you get to the bottom right corner of the screen, trying to move off of this square causes addstr to throw and exception. Every other spot works. Any idea why? Thanks:
48
4563
by: Daniele C. | last post by:
As soon as my sourceforge.net project gets approved, I am going to build a ncurses port to win32 bindable to sockets, e.g. allowing VT100/ANSI terminals and the creation of simple terminal servers using the ncurses API for the UI. I plan to initially support only a subset of the ncurses lib, leaving the lib open to expansion/completion. Please stop me if I am going to reinvent the wheel, and tell me if there are any libraries of this...
7
2854
by: Gasten | last post by:
Hello. The last weeks I've been coding a roguelike (you know, like nethack) in python using the nCurses library. Some week ago I ran into a problem: When I made the object for messagebar-output, I found a bug that I can't figure out (believe me; I've tried everything and asked for help several times on the IRC-channel). The updateMsg() and iMsg() takes a list of message-lines as argument (or process a string to a list), and it'll output...
1
9169
by: Nick ! | last post by:
Chris Share <usenet at caesium.me.ukwrote: http://web.cs.mun.ca/~rod/ncurses/ncurses.html#xterm says "The ncurses library does not catch signal, because it cannot in general know how you want the screen re-painted". First, is this really true? When I make my xterms smaller they clip what is displayed--is that a function of curses or the xterm? Second, if true, it explains /what/ is going on--stdscr, only--, but isn't really...
5
6329
by: 7stud | last post by:
I can't see to get any y, x coordinates to work with curses. Here is an example: import curses def my_program(screen): while True: ch = screen.getch() if ch == ord("q"): break
1
2355
by: Michael Goerz | last post by:
Hi, I'm trying to print out text in color. As far as I know, curses is the only way to do that (or not?). So, what I ultimately want is a curses terminal that behaves as closely as possible as a normal terminal, i.e. it breaks lines and scrolls automatically, so that I can implement a function myprint(color, text) that does what print() does, only in color. So, my first tests brought up some problems:
0
10163
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
9957
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8832
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7379
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5423
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3532
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2806
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.