Welcome to the most active Linux Forum on the web.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 09-02-2003, 08:02 PM   #1
LQ Newbie
Registered: Sep 2003
Location: Portland, Oregon
Distribution: Debian and Gentoo
Posts: 27

Rep: Reputation: 15
Question ncurses background color

I have been working on a project using ncurses for the past several months, and I am wondering how to keep the background a certain color. The background color of the initial screen will start off being a color that I would like it to be. However, once the text has reached its limit at the bottom of the screen the background color is lost. That is, once the text has filled the initial screen and begins to "scroll" downward, the background color of the text is correct, however the background color of the rest of the screen is the default terminal color. I would like to have the entire screen one uniform background color without having the end of each line to the end of the terminal be different. I am thinking most of the problem lies in the fact that the text scrolls instead of being stationary. I obviously do not know the solution, but I would think there would be a function within the library to solve this. I have spent much time looking and tried several different functions to remedy this. If you could help I would appreciate it very much.
Old 09-02-2003, 09:17 PM   #2
Registered: Sep 2002
Location: OH, USA
Distribution: 2.6.16-1.2096_FC5 #1
Posts: 245

Rep: Reputation: 30
have you tried something like :

#include <ncurses.h>

int main() {
    int i;

    /* this is my magic little line */

    for(i=0;i<2000;i++) {

    return 0;
hope that's what you meant

[NOTE] i changed some of it above because before it was too hard to tell if the screen was actually scrolling (hard to tell when you print the same character or string of i used an incrementing integer) it is definately visible [/NOTE]

Last edited by jhorvath; 09-02-2003 at 09:36 PM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
VI Background Text Color mahugl Linux - Newbie 3 12-15-2013 11:12 PM
How to Change the Cursor Color in Ncurses mac57 Programming 0 04-02-2005 04:01 PM
TTY background color! hitesh_linux Linux - General 1 09-17-2004 07:22 AM
get-background-color in GTK+-2.0 fromzj Programming 0 04-04-2004 04:46 AM
Is there a way to change background color out of X? purpleburple Linux - General 1 01-23-2003 09:32 AM > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:56 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration