ncurses

Mouse movement events in NCurses

浪子不回头ぞ 提交于 2019-12-17 16:28:01
问题 I wonder if there is such a thing as mouse movement events in NCurses, and if there is a way to catch them. Following the Interfacing with the mouse (from the NCurses programming HOWTO) it seems that by enabling the REPORT_MOUSE_POSITION bit in the call to mousemask , one can indeed catch mouse movement events. So, I tried that and it does not seem to work. I have something like this: int ch, count=0; mmask_t old; initscr (); noecho (); cbreak (); mousemask (ALL_MOUSE_EVENTS | REPORT_MOUSE

Using GNU Readline; how can I add ncurses in the same program?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-17 09:32:54
问题 The title is a bit more specific than my actual goal: I have a command-line program which uses GNU Readline, primarily for command history (i.e. retrieving previous commands using up-arrow) and some other niceties. Right now the program's output appears interspersed with the user's input, which sometimes is OK but the output is asynchronous (it comes via a network connection in response to the input commands), and that gets annoying sometimes (e.g. if lines are output when the user is typing

Using GNU Readline; how can I add ncurses in the same program?

点点圈 提交于 2019-12-17 09:32:08
问题 The title is a bit more specific than my actual goal: I have a command-line program which uses GNU Readline, primarily for command history (i.e. retrieving previous commands using up-arrow) and some other niceties. Right now the program's output appears interspersed with the user's input, which sometimes is OK but the output is asynchronous (it comes via a network connection in response to the input commands), and that gets annoying sometimes (e.g. if lines are output when the user is typing

Ncurses and Qt Interoperability

谁说我不能喝 提交于 2019-12-17 06:16:12
问题 Having a Qt and ncurses based application, what is the best way to refresh the screen every second, while waiting for user input? (e.g. show the clock and get user input). I need the best compromise between CPU usage and application responsiveness. To be more specific with the question, how to get user input and still use QTimer and the signal-slot mechanism? When using the code below, the timers doen't work. nodelay(stdscr,true); while(1) { sleep(1); getch(); processInput(); } 回答1: Use

编辑linux内核与bosybox 时,make menuconfig 出现错误

梦想的初衷 提交于 2019-12-17 01:00:48
*** Unable to find the ncurses libraries or the *** required header files. *** 'make menuconfig' requires the ncurses libraries. *** *** Install ncurses (ncurses-devel) and try again. *** 1. 问题状况 一般情况下使用系统自带的软件管理器apt-get就可以安装了(`sudo apt-get install ncurses-devel`),但使用后却出现下面的错误提示: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 E: 未发现软件包 ncurses-devel 再试了另一条命令`sudo apt-get install ncurses`, 出现: 正在读取软件包列表... 完成 正在分析软件包的依赖关系树 正在读取状态信息... 完成 现在没有可用的软件包 ncurses,但是它被其它的软件包引用了。 这可能意味着这个缺失的软件包可能已被废弃, 或者只能在其他发布源中找到 E: 软件包 ncurses 没有可供安装的候选者 2. 解决方法 Linux几乎每个发行版都会有'ncurses'及'ncurses-devel'的安装包的

What's the short way to add same symbol at the specified place in ncurses?

守給你的承諾、 提交于 2019-12-14 03:50:35
问题 I want to add str "#" in ncurse screen,with coordinate x(5 to 24) , y(23 to 42) which is a square. But I can't figure out a simple way to do it. I've tried: stdscr.addstr(range(23,42),range(5,24),'#') But this can't work. It needs 'integer'. Does anyone can figure out an easy way to do this Job? Thanks. 回答1: First two arguments of addstr should be row, col as integer but your are passing list: To make square to like this: for x in range(23,42): # horizontal c for y in range(5,24): # verticale

How to refresh curses window correctly?

≡放荡痞女 提交于 2019-12-14 00:18:47
问题 while 1: ... window.addstr(0, 0, 'abcd') window.refresh() ... window size is full terminal size, big enough to hold abcd . If 'abcd' is modified to shorter string like 'xyz' , then on terminal I will see 'xyzd' . What exactly I am doing wrong? 回答1: addstr() only prints the string you specify, it does not clear the following characters. You will have to do that yourself: To clear characters until the end of the line, use clrtoeol(), To clear characters until the end of the window, use clrtobot

I can't import MacPorts' /opt/local/include/ncurses.h into my Swift project. It conflicts with macos SDK /usr/include/ curses.h. Any hint?

吃可爱长大的小学妹 提交于 2019-12-13 21:09:53
问题 EDIT: Getting negatives for such a detailed and HONEST question? Sometimes I don't really get Stack Overflow. Really. Hi, I'm trying to create a PoC using Swift 5 (Xcode 10.2.1) and a modern rendition of ncurses (in this case, MacPorts' one, some 6.1.2018XXXX version) My Poc has no code as of now, as my problems start before being able to add any sensible line to my .swift files. So far I've done the following things: 1.- I have a proper working MacPorts ncurses library installed: that means

Ncurses menu - remembering selection

爷,独闯天下 提交于 2019-12-13 16:30:03
问题 I am using Ncurses library to do some interactive menus, and I don't know how to do one thing. I have simple menu with few options, I turned of O_ONEVALUE so many options can be selected at the same time, before posting menu I get all the menu items and mark them as selected or not, depending on a bit mask that I keep stored somewhere else, but when the menu is posted every option is turned off, here is the code: //acquiring menu items ITEM** header_items = menu_items(params.header_opts_menu)

Print a wide unicode character with ncurses

放肆的年华 提交于 2019-12-13 13:14:22
问题 I'm trying to position a star unicode character on screen using the ncurses.h library in C on Ubuntu. The code I'm trying to run is the following: #include <stdio.h> #include <wchar.h> #include <curses.h> #include <ncurses.h> #include <stdlib.h> #include <wctype.h> #include <locale.h> int main() { setlocale(LC_CTYPE, ""); initscr(); cbreak(); WINDOW *win = newwin(0, 0, 0, 0); refresh(); wrefresh(win); const wchar_t* star = L"0x2605"; mvaddwstr(3, 3, star); getch(); endwin(); } But I keep