ncurses

Menus library with PDCurses

泄露秘密 提交于 2019-12-11 10:56:45
问题 I'm currently learning to program with NCurses/PDCurses by reading this tutorial: http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ But when I get to chapter 17 which is about the menus library, I'm getting kind of stuck. #include <menu.h> doesn't work, and I can't find menu.h in the pdcurs34 folder. Is there a way to add the menus library (menu.h) to PDCurses? (PS: I'm using MS Visual Studio.) 回答1: The menu library is part of the ncurses package I don't think the menu library will work with

getting trouble with execlp()

不羁岁月 提交于 2019-12-11 09:56:51
问题 I am using execlp to implement a net based command but its not working.I am using execlp("telnet 0 5000","telnet 0 5000",(char *)NULL); delwin(menubar); delwin(messagebar); endwin(); but its not working else than that if i replace telnet 0 5000 with ls it will work but the output comes on the same screen means on the GUI and noecho get activates automatically and output of ls comes in a pretty unusual manner. below is my full code . #include <curses.h> #include <stdlib.h> #include<stdio.h>

Can I show strings on ncurses screen without getch() function?

血红的双手。 提交于 2019-12-11 08:52:09
问题 Currently, I know only one way to show strings using ncurses library, like as below: import curses stdscr = curses.initscr() stdscr.addch(0,0,'x') stdscr.getch() But I've met a problem when I want to make a falling function of string . import curses import time stdscr = curses.initscr() y=1 def fall(): global y stdscr.addstr(y,0,'x') stdscr.move(y-1,0) stdscr.clrtoeol() y += 1 stdscr.getch() while True: time.sleep(0.2) fall() If I remove this getch() function, I can't see the ncurses screen.

Deploying C-dependent Perl libraries

倾然丶 夕夏残阳落幕 提交于 2019-12-11 06:54:49
问题 I have an application that I deploy on both Linux (Red Hat) and Unix (Solaris). My application installs itself using the built in Perl, and from then creates its own local Perl (new user). I would like to know what is the best way to deploy Curses::UI? Currently I install other modules by just copying them to my local perl lib folder, but these are pure Perl modules that don't depend on C libraries (.so shared objects, XS, etc.). Also will I have to compile libncurses for each platform

Output “█” with ncursesw in C

橙三吉。 提交于 2019-12-11 06:16:45
问题 I'm making a tetris game in C to run on an embedded system, but I'd like to have a mock up interface made using Block characters such as "█" (UNICODE 0x2588). I'm already using ncursesw and have heard mentions of using wprintw() instead of prints(). printw("%i %i %i %i %i %i %i %i %i\n",board[0][i],board[1][i],board[2][i],board[3][i],board[4][i],board[5][i],board[6][i],board[7][i], piece); What should this line be in order to output "█"? 回答1: The are no print functions, just the addwstr

Getch() incompatible with display function in linux c++

泄露秘密 提交于 2019-12-11 05:42:29
问题 I am making a 2D dungeon crawler type game for a class. I am trying to receive user input without requiring the enter key to be pressed. Specifically, I want to use w a s d as directional keys to move around a 2D array. I've tried using the ncurses library but it currently messes with my display function (I believe when using endl). Normally my board displayed will look like: xxx xxx xxx But when using getch() from the ncurses library my board looks like: xxx ......xxx ............xxx Is

g++ can't find ncurses.h despite it being installed

房东的猫 提交于 2019-12-11 04:14:51
问题 I'm trying to experiment around in ncurses for the first time, but I'm having problems compiling my source code. As far as I can tell, ncurses is installed and in the proper directories. My makefile is super simple: .cpp : g++ -Wall -g -o $* $*.cpp -std=c++11 -lncurses and here's my output when I try to locate ncurses.h $ locate ncurses.h /usr/include/ncursesw/ncurses.h and when I check to see if it's installed $ dpkg -l | grep ncurses ii libncurses5:amd64 5.9+20140118-1ubuntu1 amd64 shared

Ncurses No Output

筅森魡賤 提交于 2019-12-11 04:03:14
问题 Platform: Linux 3.2.0 x86 (Debian Wheezy) Compiler: GCC 4.7.2 (Debian 4.7.2-5) I am writing a program that requires advanced terminal control that is provided by ncurses but I cannot get my program to print anything to stdscr. For example if I compiled the following code I would not see "Testing.. Testing" on the screen. I have used ncurses before and I have never encountered such a problem. I do not know if this is relevant or not but I am running a fresh install of Debian (I literally

How can I know that the user hit the ESC key in a console with ncurses (Linux)?

爱⌒轻易说出口 提交于 2019-12-11 03:09:43
问题 I have a problem in detecting whether I just got a plain ESC key (just code 27) or whether it was another special key such as an Arrow Up which sends me three bytes: ESC [ A (27 91 65). Now, I understand escape sequences, what I don't understand is how can I possibly know that the user actually typed ESC instead of a special key since both start with 27 and ESC is only 27? Note that I use the wgetch() function from ncurses as in: // initialization not shown initscr() should be enough for this

Curses library doesn't support wide char on OS X high sierra

て烟熏妆下的殇ゞ 提交于 2019-12-11 03:07:26
问题 OS X 10.13.2 (high sierra). I'm trying to write simple curses program with widechar support, but it appears, that default (pre-installed library) curses doesn't support widechar: Simplest program example (from here): #include <ncursesw/ncurses.h> #include <locale.h> #include <wchar.h> int main() { setlocale(LC_ALL, ""); initscr(); wchar_t wstr[] = { 9474, L'\0' }; mvaddwstr(0, 0, wstr); refresh(); getch(); endwin(); return 0; } doesn't compile, gives error: test.cpp:1:10: fatal error: