ncurses

calling calloc - memory leak valgrind

The following code is an example from the NCURSES menu library. I'm not sure what could be wrong with the code, but valgrind reports some problems. Any ideas... ==4803== 1,049 (72 direct, 977 indirect) bytes in 1 blocks are definitely lost in loss record 25 of 36 ==4803== at 0x4C24477: calloc (vg_replace_malloc.c:418) ==4803== by ...

realloc - converting int to char

I'm converting an array of integers into a char by iterating through the whole array, and then I'm adding the resulting string to ncurses's method new_item. For some reason I'm doing something wrong the way I reallocate memory, thus I get the the first column as: -4 Choice 1 0 Choice 1 4 Choice 2 1 Choic...

[C++ / NCURSES] Can't convert from 'int' to 'int *'

So I have these lines of code: int maxY, maxX; getmaxyx(stdscr, &maxY, &maxX); It gives me the following error: error C2440: '=' : cannot convert from 'int' to 'int *' Conversion from integral type to pointer type requires reinterpret_cast, C-style cast or function-style cast twice for each time I use it. I'm not even using...

Linker warnings when using stdscr (ncurses)

Okay, so I'm getting these warnings whenever I try to use stdscr in pdcurses: LINK : warning LNK4098: defaultlib "LIBC" conflicts with use of other libs; use /NODEFAULTLIB:library LINK : warning LNK4049: locally defined symbol "_stdscr" imported LINK : warning LNK4049: locally defined symbol "_SP" imported How do I fix this? They're j...

get the text in the display with ncurses

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.. ...

Where can I find a good book on writing curses applications with perl?

I have been in search of a good way to write curses apps. So far I have found Curses::UI and Curses::Toolkit, but none of them are as maleable as I want them to be. Now I'm looking to write my app with just Curses itself, and learn something about it in the process! Are there any good books/tutorials/etc. that would teach me the guts ...

How can I modify the keyboard repeat delay in a linux console, with or without ncurses

I'm writing a little pong clone with ncurses and C. I need to find a way to set the keyboard repeat delay to make it easier for a player to move the paddle, otherwise they are stuck hitting the down key and waiting about 50 milliseconds until the key begins to repeat. I've checked the ncurses man pages and documentation, and I can't see...

ncurses and white-on-black

I can't seem to get white-on-black to work in curses when in color mode. If I don't call start_color, I get white-on-black. As soon as I call start_color, things start outputting in grey-on-black. If you run this script: import sys for i in xrange(30, 38): print '\x1b[0;' + str(i) + 'm' + str(i) + ': Shiny colors \x1b[1m(bright)' ...

C - going from ncurses ui to external program and back

I'm making a program that displays some info in ncurses, and then opens vim (using system) to allow the user to edit a file. After vim is exited, though, the ncurses screen won't redraw. refresh and wrefresh don't do anything, resulting in the complete trashing of my beautiful menu. So, I get sent back to the command line. The menu i...

C - curses keyboard doesn't work after def_prog_mode and reset_prog_mode, refresh

I am trying to go from my ncurses UI to an editor via a system call and then back again. With the help of several friendly programmers here, I learned how to use def_prog_mode and refresh to restore the state of my terminal UI after the user returns from the editor. So my code looks something like this: // save state and exit ui def_p...

Need help with ncurses cursor and threads

I am using ncurses to write a text-based client in C. The main loop of the program simply blocks until a keypress is detected and then handles it and continues to wait for another keypress. I have a single thread I launch (posted below) that blocks (using select) waiting for input from the server and when it receives it adds it to the c...

Printing double-size characters with Ncurses

Many terminal emulators (xterm, Konsole) support double-size characters. Ncurses does not support this and as far as I know, ncurses will not print escape characters (\033 will be unescaped and printed in clear text). Is it possible at all to print double-size characters in a ncurses application? ...

Statically link ncurses to program

I'm having some problems statically linking ncurses to one of my programs Here's a really simple sample program: #include<ncurses.h> int main(){ initscr(); printw("Hello world\n"); refresh(); getch(); endwin(); return 0; } When I compile it with gcc -static -lncurses hello_curses.c -o curses I get these...

Print raw data when using the Curses development kit (Cdk)

My perl program needs to jump between ncurses and a raw console as it executes a system call in a loop, like this (simplified for problem emphasis): init Cdk present menu deinit Cdk run system call Unfortunately Cdk appears to initialize ncurses at the use Cdk import and not instantiation (Cdk::init()) and so I don't know how to di...

CLI pdf viewer for linux

Hey, for quite a while now, I am looking for a pdf viewer for the command line. As I like to work without X on Linux, and often work on a remote machine, I would like to have a tool to read pdfs. There are quite a lot of really good graphical programs (evince, okular, acroread, ...) to do the job, so I figured there should be at least o...

How would one go about developing a curses-based UI?

Hello! I'm planning to develop a GUI application that uses curses. The idea is to provide an extra interface for a web interface, so that everything on the web site could also be done via the UI. Basically, it should be platform independent: the user would have to SSH to the server after which the UI would automatically take over. Fi...

Color console boxes in linux terminal

So I have noticed that things (for lack of a better word) like this and are just done in the console using special characters and changing their color. I know how to accomplish this on windows but how would I go about doing this in linux (I am using ubuntu if that matters)? Are there any predefined classes out there to help const...

GUIs vs TUIs in Python

I'm interested in doing rapid app development in Python. Since this is mainly for prototyping purposes, I'm looking for a way of creating "rough" user interfaces. By this, I mean that they don't have to look professional, they just have to be flexible enough to make it look the way I want. Originally I was going to do this by creating a ...

Compiling NCURSES src on HPUX

I am trying to compile ncurses-5.7 from source and after running ./configure I get the following error: configure: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler c. use a wrapper such as unproto how can...

How does Vim display :ls results (curses/cooked mode)

When I am inside Vim, and i type ":ls", Vim lists the buffers. Most likely it is going into "cooked mode" using def_prog_mode() and endwin(). WHat I'd like to know how does it print the values now. The best i've come out with is using system("echo ....")which would be quite laborious. I've tried printf - no effect, and printw. I need to...