473,748 Members | 2,552 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 1839

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
6104
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
1035
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
4554
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
2850
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
9167
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
2354
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
8995
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8832
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9561
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
9332
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
9254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6078
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
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
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
3
2217
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.