xterm help

This is a discussion on xterm help within the Linux Programming forums, part of the Platform Specific Boards category; ok im running linux RH7.3 and my console can accept colors.. cause itz xterm.. but the problem here is that ...

  1. #1
    Registered User
    Join Date
    Dec 2001
    Posts
    227

    Unhappy xterm help

    ok im running linux RH7.3 and my console can accept colors.. cause itz xterm.. but the problem here is that im coding in ncurses... (i have posted this before but im tring to findout how to use ncurses in my console) but when i try to run the code all i see is just a gray little box on the left hand top corner of my screen so can anyone help me fix this to work on my term... ? thanx here is the code

    Code:
    #include <stdio.h>
    #include <ncurses.h>
    
    int main()
    {
    
    initscr();
    noecho();
    cbreak();
    start_color();
    
                  init_pair(2, COLOR_RED, COLOR_RED);
          attron(COLOR_PAIR(2));
          wprintf("hello colorz");
          refresh();
          attroff(COLOR_PAIR(2));
    
    
     sleep(3);
     endwin();
     return 0;
    
     }
    this damn thing should work ... i never had problems untill i upgraded my version of linux to RH7.3(hade rh 7.2)

  2. #2
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    >>>wprintf("hello colorz");
    Try changing this to:
    >>printw("hello colorz");

    .... works for me, might do for you.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  3. #3
    Registered User Fredd's Avatar
    Join Date
    Oct 2002
    Posts
    69
    #include <stdio.h>
    i dont think you need that... if im not mistaking ncurses.h includes it.

    try
    Code:
     if(has_colors() ==FALSE) {
    to see if your terminal supports colors. if it doesnt that might be the problem
    "Writing software is more fun than working."

    got slack?
    http://www.slackware.com/

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. query on xterm?
    By msenthil in forum Tech Board
    Replies: 4
    Last Post: 06-05-2007, 03:31 AM
  2. Execl()ing xterm and stdin
    By RollingSkull in forum C Programming
    Replies: 1
    Last Post: 12-08-2006, 05:04 PM
  3. Xterm
    By MethodMan in forum Linux Programming
    Replies: 2
    Last Post: 05-04-2002, 02:58 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21