curses bkgd problem

Gandalf gandalf at geochemsource.com
Mon Mar 8 17:07:34 CET 2004


  Hi Python Gurus!

I read the documentation on the python curses module and I started a new 
application.
So far I did this:

stdscr = curses.initscr() # Get standard screen
curses.start_color()      # Uses colors
stdscr.bkgd(' ',curses.COLOR_BLUE ) # Set background of the main window
curses.noecho()           # Do not echo input
curses.cbreak()           # CBreak mode: process keys immediately (no ENTER)
stdscr.keypad(1)          # keypad mode: parse control sequences
stdscr.redrawwin()
stdscr.refresh()

However, it is displaying $ characters in black instead of displaying a 
blue background full of spaces.
This must be a problem with my bkgd call since this works fine:

curses.init_pair(1, curses.COLOR_RED, curses.COLOR_WHITE)
stdscr.addstr(0, 0, curses.longname(), curses.color_pair(1) )
stdscr.refresh()

(writes "X11$terminal$emulator" in the top left corner in red and white).
Please help me out with a few lines of code.

Thanks in advance.

   G






More information about the Python-list mailing list