curses

pdcurses linkage using Visual Studio 2010

北城以北 提交于 2019-12-21 05:31:25
问题 This is doing my nut in. I'm just trying to include pdcurses (i.e. ncurses for windows) into a test program. Linkage though is failing. Using Visual Studio 2010. I'm fully aware of setting up the correct link additional libraries path and to list the libraries themselves. No joy. I've tried the various pre-builts on the pdcurses website. No such luck. I of course resorted to building from source. Using nmake from the Visual Studio command prompt as prescribed. Built ok. Nada on link. What am

Console interface tutorials and tips (pdcurses)

两盒软妹~` 提交于 2019-12-21 05:00:37
问题 I'm looking for tutorials on using PDCurses library. Unfortunately there is text only documentation, which is more like function reference. Are pdcurses similar enough to ncurses to use ncurses tutorials??? Any tips for making console UI's ??? PS. PDCurses - mingw32. 回答1: This blog entry isn't anything I'd call a tutorial but it looks like it might be an interesting starting point. It is featuring a (very, very basic) video tutorial on YouTube as well. 回答2: You can always use this tutorial

What is the recommended way to implement text scrolling in ncurses?

倖福魔咒の 提交于 2019-12-20 23:26:11
问题 I am trying to implement an ncurses app with text scrolling like less. What is the recommended way to do this? Here's what I know: You can use scroll to move the text buffer up or down by 1 row. However, you'll end up with one blank line at the top if you scroll down, or at the bottom if you scroll up, which you'll have to repaint yourself. Ncurses does wordwrap for you, which messes up my math when I have to determine what line I have to repaint in step 1. I guess I could re-implement

G++ can't find references to raw() or cbreak(), even when linking curses [duplicate]

荒凉一梦 提交于 2019-12-20 03:20:01
问题 This question already has an answer here : DSO missing from command line [duplicate] (1 answer) Closed 2 years ago . I'm having trouble getting some absolute basic work with curses.h done, even though I've worked with it before. I'm sure it's a classic case of missing something small, but I'm at my wit's end. G++ absolutely won't recognize the functions raw() or cbreak(), even though curses.h is included in my .cpp and header file, and linked to when compiling with (minimal version): g++

get the text in the display with ncurses

旧时模样 提交于 2019-12-20 02:28:13
问题 Is there any way to get back the characters outputted into a variable on ncurses ? let's say I do: printw("test"); then I want to be able to: somefunc(strbuffer); printf("%s",strbuffer); // test I need a function to get back all characters on the screen into a variable, scr_dump get's close but the output format is unreadable.. 回答1: If you put stuff on the screen using curses functions (e.g. addch, mvaddch, addstr) you can use inchstr) and related functions to read the characters from the

Why won't my curses box draw?

南笙酒味 提交于 2019-12-19 10:47:33
问题 I am toying with curses and I can't get a box to draw on the screen. I created a border which works but I want to draw a box in the border here is my code import curses screen = curses.initscr() try: screen.border(0) box1 = curses.newwin(20, 20, 5, 5) box1.box() screen.getch() finally: curses.endwin() any advice? 回答1: From curses docs: When you call a method to display or erase text, the effect doesn’t immediately show up on the display. ... Accordingly, curses requires that you explicitly

Python Curses initscr Error

别等时光非礼了梦想. 提交于 2019-12-19 10:07:50
问题 I'm trying to initiate screen = curses.initscr() But it failed and returns File "C:\Python32\lib\curses\__init__.py", line 31, in initscr fd=_sys.__stdout__.fileno()) AttributeError: 'NoneType' object has no attribute 'fileno' Here's my system Python 3.2.3 (default, Apr 11 2012, 07:12:16) [MSC v.1500 64 bit (AMD64)] on win32 This is my first time running python on this computer, it's Windows 7 64bit. Is this has something to do with my OS? Anyway I can solve this? 回答1: You can't use the

ncurses and stdin blocking

笑着哭i 提交于 2019-12-18 13:36:46
问题 I have stdin in a select() set and I want to take a string from stdin whenever the user types it and hits Enter . But select is triggering stdin as ready to read before Enter is hit, and, in rare cases, before anything is typed at all. This hangs my program on getstr() until I hit Enter . I tried setting nocbreak() and it's perfect really except that nothing gets echoed to the screen so I can't see what I'm typing. And setting echo() doesn't change that. I also tried using timeout(0) , but

Is there a way to interactively program a Python curses application?

我的未来我决定 提交于 2019-12-18 12:19:41
问题 Is there a way to create a second terminal so that all calls to curses functions operate on that, rather than in the existing terminal? I work much faster when I can try things out interactively, so I'd like to be able to run an interactive python interpreter in one terminal and see the curses output in another. As it is, calling initscr() in an interactive window either fails (PyDev) or permanently takes away window refresh from the host (Spyder) or causes weird behavior in the console

how to get a character from stdin without waiting for user to put it? [duplicate]

不羁岁月 提交于 2019-12-18 04:21:34
问题 This question already has answers here : How to avoid pressing enter with getchar() (11 answers) Closed 3 years ago . I'm writing a C program that prints something on terminal using ncurses. It should stop printing when user press 's' and continue again when press 's'. How can I read a key from input without waiting user to press the key? I tried getch() and getchar() but they wait until a key is pressed... Edit This is my code: int main(void) { initscr(); /* Start curses mode */ refresh(); /