ncurses

Undefined reference when using ncurses on linux

烈酒焚心 提交于 2019-11-29 08:25:10
问题 I'm trying to start developing a program using ncurses on Linux. I can't even get the Hello World example to compile. Here's the code: #include <curses.h> int main() { initscr(); printw("Hello, world."); refresh(); getch(); endwin(); return 0; } When I attempt to compile, I get: hello.c:(.text+0x12): undefined reference to `initscr' For every one of those called functions. I installed ncurses via apt-get, and also by downloading the sources and compiling, installing, etc. I have tried

Qt macro keywords cause name collisions

做~自己de王妃 提交于 2019-11-29 07:37:52
I am building an NCurses interface for my Qt project. I want to use CDK but I think the signals member of this struct is colliding with the Qt signals keyword. /usr/include/linux/cdk.h:411: error: expected unqualified-id before 'protected' How can I get CDK to work with Qt? You can define the QT_NO_KEYWORDS macro, that disables the “signals” and “slots” macros. If you use QMake: CONFIG += no_keywords ( Qt Documentation here ) If you’re using another build system, do whatever it needs to pass -DQT_NO_KEYWORDS to the compiler. Defining QT_NO_KEYWORDS will require you to change occurrences of

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

徘徊边缘 提交于 2019-11-29 05:02:34
This question already has an answer here: How to avoid pressing enter with getchar() 10 answers 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(); /* Print it on to the real screen */ int i = 0, j = 0; int state = 0; while (1) { cbreak(); int c = getch(); /* Wait for user

NCurses and Perl, any guides? [closed]

回眸只為那壹抹淺笑 提交于 2019-11-28 21:39:15
I need to use NCurses, with Perl. I found some very short bits of text about it but no example at all. Is there anyone aware of any existing guide online? Thanks! DVK http://metacpan.org/pod/Curses::UI::Tutorial http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ The examples from tldp.org are: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ncurses_programs/perl/ Also, from http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q3.8.html : For a good example of using curses with Perl, you might want to pick up a copy of Steven L Kunz's* perl menus'' package ( menu.pl'') via anonymous FTP from ``ftp

Python ncurses, CDK, urwid difference

喜夏-厌秋 提交于 2019-11-28 20:01:30
问题 What's the difference between these 3? As far as I understand it they both provide binding to curses which is the C library for terminal text-based UI. I currently have no knowledge of any of the 3 and I've never used curses. Which one would you recommend? I've heard of ncurses many times but only once or twice about CDK (through research) and never heard of urwid (I think). 回答1: What I get after looking at some references is: ncurses: It's a free software version of curses, so you have to

How to get ncurses to output astral plane unicode characters

ε祈祈猫儿з 提交于 2019-11-28 18:15:36
I have the following piece of extremely simple code, which is supposed to output (amongst other things), three unicode characters: /* * To build: * gcc -o curses curses.c -lncursesw * * Expected result: display these chars: * http://www.fileformat.info/info/unicode/char/2603/index.htm (snowman) * http://www.fileformat.info/info/unicode/char/26c4/index.htm (snowman without snow) * http://www.fileformat.info/info/unicode/char/1f638/index.htm (grinning cat face with smiling eyes) * * Looks like ncurses is NOT able to display second and third char * (only the first one is OK...) */ #include

What's the best way to get text user-interfaces (ncurses-like) functionality in Java?

假如想象 提交于 2019-11-28 17:54:51
I need to implement a console application (possibly in Java) with ncurses-like functionality (such as navigating a menu and redrawing the whole screen). The only solutions that I can find to do this so far are CHARVA ( "A Java Windowing Toolkit for Text Terminals" ), tuipeer ( "A Text User Interface for the Java AWT" ) and a really old Dr. Dobb's article ( "A Text UI for the Java AWT " ). So far, CHARVA is the best thing that I can find but I don't like the idea of it using JNI to wrap curses. Is there any standard way, say with AWT/Swing, to do do this? What other alternatives are there?

In-place progress output in the terminal or console

二次信任 提交于 2019-11-28 17:50:35
When you run git clone , it updates progress in place. For example, the percentage of the objects received changes in place. user@athena:~/cloj/src$ git clone git://git.boinkor.net/slime.git Initialized empty Git repository in /home/user/cloj/src/slime/.git/ remote: Counting objects: 15936, done. remote: Compressing objects: 100% (5500/5500), done. Receiving objects: 28% (4547/15936), 3.16 MiB | 165 KiB/s How is this acccomplished? Does it use ncurses or something even simpler, like some combination of backspace characters and regular character output? I'm especially interested in how this

What is the difference between xterm-color & xterm-256color?

妖精的绣舞 提交于 2019-11-28 17:14:33
问题 I've come across both xterm-color and xterm-256color as options when trying to set up my terminal program to use color - i.e. you can set your TERM environment variable to either one. I was wondering if anyone can describe the difference between the two? I've searched for documentation on my Ubuntu server as well as my mac but haven't found any. I've only been able to find various binary files in /usr/share/terminfo . 回答1: xterm-256color describes Xterm with support for 256 colors enabled.

Borders don't draw properly when window has more than 8 columns

不打扰是莪最后的温柔 提交于 2019-11-28 12:25:48
问题 The border drawing functions just don't seem to draw the top and bottom borders properly when the window's width is above 8. As a disclaimer, I'm using KiTTY to SSH into an Arch Linux server. I'm a newbie to ncurses, so there's a good chance I'm doing something wrong, but from what I've read this should be right... #include <ncurses.h> int main() { initscr(); cbreak(); WINDOW *win = newwin(1,1, 1,1); for(int i=1; i < 16; ++i) { wresize(win, i, i); wclear(win); box(win, 0,0); // I've also