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 0 1834 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
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...
|
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
|
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()
|
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:
|
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...
| |
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...
|
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...
|
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
|
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:
|
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...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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,...
|
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...
|
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...
|
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();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
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...
| |