Linux.com

Chronos

Chronos

  • Linux.com Member
  • Posts: 4
  • Member Since: 20 Dec 10
  • Last Logged In: 31 Jul 13

Latest Posts

Posted by
Topic
Post Preview
Posted
  • Chronos
    RE: ncurses - start_color - screen color
    I contacted Thomas Dickey and he very kindly helped me. Use [b]use_default_colors()[/b] after [b]start_color()[/b] See [b]http://invisible-island.net/ncurses/ncurses-intro.html[/b] - search for [b]use_default_colors()[/b] This will use the terminal colors as you have them set up. For example: [code] initscr(); // Start curses mode if(has_colors() == FALSE) // Check the terminal has colour capability { endwin(); // Close Window and leave ncurses printf("Your terminal does not support colour. "); return(1); // Leave the program } start_color(); // Start colour mode use_default_colors(); ... ... [/code] Alan
    Link to this post 14 Jun 12

    I contacted Thomas Dickey and he very kindly helped me. Use use_default_colors() after start_color()

    See http://invisible-island.net/ncurses/ncurses-intro.html - search for use_default_colors() This will use the terminal colors as you have them set up.

    For example:


    initscr(); // Start curses mode

    if(has_colors() == FALSE) // Check the terminal has colour capability
    {
    endwin(); // Close Window and leave ncurses
    printf("Your terminal does not support colour. ");
    return(1); // Leave the program
    }

    start_color(); // Start colour mode

    use_default_colors();
    ...
    ...

    Alan

  • Chronos
    RE: ncurses - start_color - screen color
    Thanks for the link I will follow it up. Alan
    Link to this post 13 Jun 12

    Thanks for the link I will follow it up.

    Alan

  • Chronos
    ncurses - start_color - screen color
    When using [b]start_color[/b] command in [b]ncurses[/b] the screen starts with a black background. Is there any way of resetting this to another color? If this is not the appropriate forum for this question - sorry and please redirect me. TIA Alan
    Link to this post 11 Jun 12

    When using start_color command in ncurses the screen starts with a black background. Is there any way of resetting this to another color?

    If this is not the appropriate forum for this question - sorry and please redirect me.

    TIA

    Alan

  • Chronos
    Disk Defragmentation
    In Windows it was recommended that disks be defragmented regularly. Does this need to be done in Linux? If so, how? If not, why not? TIA Alan
    Link to this post 16 Jan 11

    In Windows it was recommended that disks be defragmented regularly. Does this need to be done in Linux? If so, how? If not, why not?

    TIA

    Alan

Who we are ?

The Linux Foundation is a non-profit consortium dedicated to the growth of Linux.

More About the foundation...

Frequent Questions

Join / Linux Training / Board