curses

What's wrong with my code? (pdcurses/getmaxyx)

It gives me an access violation on the getmaxyx line (second line in the main function) and also gives me these two warnings: LINK : warning LNK4049: locally defined symbol "_stdscr" imported LINK : warning LNK4049: locally defined symbol "_SP" imported Yes, it's the same code as in another question I asked, it's just that I'm making ...

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

Python curse getmouse function?

I'm trying to find a way to get mouse click event in curse module in Python. I read the document on http://docs.python.org/library/curses.html and it suggested to do c == curses.getch() if(c == curses.KEY_MOUSE): curses.getmouse() ... However, this "if statement" seems to never get triggered... and if I tried to move the getm...

Mac version of Python doesn't support UTF-8 in curses module? [Solved]

Hi, I'm trying to display a lot of unicode text in my curses application. My development machine is MacOSx 10.6 and I use the default python shipped with Apple. Python 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin When I added unicode text to the screen, the screen all messed up. I tried to ...

python curses.newwin not working

I'm learning curses for the first time, and I decided to do it in python because it would be easier than constantly recompiling. However, I've hit a hitch. When I try to update a seccond window, I get no output. Here's a code snippet: import curses win = curses.initscr() curses.noecho() curses.cbreak() curses.curs_set(0) field = curses...

How can I specify a transparent background using Perl and Curses?

I am trying to get the background the standard terminal color instead of black but I can't seem to figure it out. When I use use_default_colors() the standards is just like not using colors but I would like to change the foreground color and not the background color. I use init_color_pair(1, COLOR_RED, COLOR_BLACK); but that gives me a b...

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

Detect Caps Lock in Python curses

For such a basic question, I'm surprised I couldn't find anything by searching... Anyways, I made a curses app in Python that assists in solving puzzles of a certain DSiWare game. With it, you can take a puzzle and inspect the components of it individually. The keys qweasdzx are used to paint tiles (the keys are arranged in some sort ...

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

[C, Mac] getyx return -1 -1

#include <stdio.h> #include <curses.h> int main () { int y, x; getyx( curscr, y, x); printf("x=%i, y=%i", x, y); return 0; } gcc a.c -lcurses -o a x=-1, y=-1 Why? ...

GNU compiler KEY_F not detecting function keys

Basically, I have key detection for my console application, for some reason it's not detecting function keys. Here is my code, I'm using GNU compiler on linux. Any help or ideas would be greatly appreciated. refresh(); key = getch(); switch(key) { case KEY_HOME: key = HOME; break; ...

Python can't compile _curses module on Debian Lenny

Hi all, My Python (2.6) installation on a few servers has been compiled without curses support which I now need, although the servers have libncurses5 installed, Python did not compile the bindings for it so when I "import curses" I get: "ImportError: No module named _curses" my /lib/ dir has the following files and symlinks: lrwxrw...

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

How do you get the last arrow key pressed using curses?

I'm writing a Python snake game using curses, but am having some trouble controlling the snake, my current code for controlling the snake is placed inside the main loop and looks like this: while True: char = screen.getch() if char == 113: exit() # q elif char == curses.KEY_RIGHT: snake.update(RIGHT) elif char == curses...

python print not functioning correctly after using curses

I have created a simple gui with curses. However, when the curses menu is finished the print function does not print anything to screen until the main program exits. In the example below, when calc.py is run, the text "Directory list ok" is printed to the screen after the foo(calcDirs) is run. If I comment out the line folderSelection....

Python stdout doesn't flush correctly after calling curses.

I have a program that uses curses, and then returns to the main script for further processing. After it returns, my subsequent output to stdout does not appear until there's a large amount of it (e.g. thousands of bytes). I've reduced the problem to a very simple program that fails reliably: import curses import time curses.initscr() ...

Which characters to choose when "drawing" a box on Windows console?

I'm trying to port a curses program to Windows. Now one of the problems is that the default ACS_XXXX characters become double-width on Windows console, thus breaking the alignment. I tried looking for other characters to do the job, like '-' or '|' in basic ASCII, but none of them looks good because the line is not continuous. And findi...