ncurses

ncurses forms: Show editing cursor / highlight active field

柔情痞子 提交于 2019-12-12 04:08:25
问题 I’m new to programming and I’d like to realise the following with ncurses in C: A form with fields to fill out and underneath this form, there is a continuously changing sensor value to be observed by the user during filling out the form, which results in the desired actions. I’m glad I made it that far, that I can put the field buffer into my variables now, by pressing return, but now I’m facing a problem which seems to be not googleable. My program started off from the example, which I

NCURSES printw Getting correct output of keycodes for RETURN and SPACE

混江龙づ霸主 提交于 2019-12-12 03:18:30
问题 Okay the code I'm working with below works great with the exception of printing out the correct information for the keys RETURN and SPACE. I have tried many approaches but this one seems the closest. UPDATE: as per recommend by Thomas Dickey, #include <ncurses.h> int main() { initscr(); cbreak(); /* as per recommend Thomas Dickey */ noecho(); /* as per recommend Thomas Dickey */ int c, SPACE=32, RETURN=10; /* i know this is wrong but..? */ /* with changes return key is 10 , yet name for keys

doing initscr() in a loop causes error initialisation

萝らか妹 提交于 2019-12-12 01:49:42
问题 I'm trying to make a simple ncurses program to display a box with messages. Im following this link and it works well. The problem that I'm having is that if I put the whole code in a function and call it in a loop, the initialisation is having an error. As far as I know, if I called endwin() at the end of the function, there shouldn't be any problem calling the initscr() again. Am I missing a function to enable the initscr() to be called again? This is the code: #include <stdio.h> #include

capture ncurses shell output in PHP

╄→尐↘猪︶ㄣ 提交于 2019-12-11 23:35:58
问题 okay so i dont know if this is possible and to be honest im leaning more towards the not possible end of the scale but i thought it might be worth asking. Basically what i am wanting to know is if it is possible to capture shell output rendered with ncurses in php for use with tools such as htop. i have noticed that php has a whole bunch of experimental ncurses functions but they all seem to be aimed at creating content not reading it. Ideally id like something where i could end up with

ncurses, print and contemporary acquire strings

梦想与她 提交于 2019-12-11 21:24:15
问题 A program written in C uses ncurses . A while cycle is used to continuously check if a new message is arrived in a queue: if it is, the message is printed on screen and then removed from the queue: while (condition) { if (queue_not_empty) { printw(element_from_queue); refresh(); remove(element_from_queue); } } At the same time, however, the program should be able to acquire an input string from the user and then store it in the array char message[100] through a scanw . But if I put while

NCurses: Setting last character on screen (without scrolling enabled)

放肆的年华 提交于 2019-12-11 20:07:41
问题 Assume you have a NCurses Window (could be a subwindow) with dimensions ROWS and COLS. How do I set the character at ROWS-1 and COLS-1. If I use waddstr at this position with one character it doesn't work (throws a user exception). I assume this is because the cursor is moved to a position outside the window? 回答1: The behaviour seems to be intentional: http://old.nabble.com/Setting-last-character-on-screen-%28without-scrolling-enabled%29-to33969235.html checking portability: Solaris 10

ncurses not capturing mouse movements but terminal is

回眸只為那壹抹淺笑 提交于 2019-12-11 18:57:26
问题 I am able to echo -e "\e[?1003h" and watch as my terminal gobbles up mouse movement events like candies but curses doesn't seem to want them at all. I looked at Mouse movement events in NCurses but it would appear that this issue was resolved by changing the TERM env, which would not help me because my terminal is indeed responding to mouse move events, however, ncurses is not. Here's something I have tried (This code came almost entirely from the other question): #include <ncurses.h>

NCurses with WSL Displaying Boxes Incorrectly

不打扰是莪最后的温柔 提交于 2019-12-11 18:31:19
问题 I am using ubuntu on my windows computer using the windows subsystem for linux to compile a simple program using ncurses in C that shows a box inside a ncurses window. As seen in the picture below, the box does not render fully. Is there something wrong with my code or is this an issue within WSL? The drawn box displays incorrectly The box should stretch and connect the left and right sides int main() { initscr(); noecho(); cbreak(); int sizeY, sizeX; getmaxyx(stdscr, sizeY, sizeX); WINDOW

Clang on macOS fails linking lmenu from ncurses

那年仲夏 提交于 2019-12-11 16:38:11
问题 I'm new to using the ncurses library, so I've been trying to recreate some of the examples on this page, http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/index.html. I've gotten the section about creating menus, specifically example 21. The program I've written works on Linux, specifically Ubuntu 18.04, but I'm not able to compile when I'm using the Menu library. All the other example programs I've written using JUST ncurses compiles fine without issue, it's just when I try to use the Menu

Xcode + swift + Darwin.ncurses = “A_BOLD not found” compilation error. I can't get bright colors

若如初见. 提交于 2019-12-11 15:23:41
问题 I'm creating a silly utility under XCode 10.2.1, with a swift + ncurses template. The compilation environment seems amazingly easy to setup: 1.- You import some Darwin.ncurses at the beginning of your main.swift file 2.- You start to invoke the typical ncurses primitives (to create some "color brushes") 3.- You addstrings to the ncurses canvas and your text appears happily rendered. So far so good, but I need something more than the 8 dark colors my Darwin.ncurses apparently gives. I googled