Asking for a sample curses library demo / usage in AIX - Aix

This is a discussion on Asking for a sample curses library demo / usage in AIX - Aix ; Hi, Anyone knows a sample source code that demonstrates curses library in AIX (I'm currently using AIX 5L 5.3). In brief, I just wanted to display a text (echoing) using a color (e.g.: blue, green, etc.). Please, I couldn't find ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Asking for a sample curses library demo / usage in AIX

  1. Asking for a sample curses library demo / usage in AIX

    Hi,

    Anyone knows a sample source code that demonstrates curses library in
    AIX (I'm currently using AIX 5L 5.3). In brief, I just wanted to
    display a text (echoing) using a color (e.g.: blue, green, etc.).
    Please, I couldn't find it by search engine.

    Thanks In Advance,

    Richard.


  2. Re: Asking for a sample curses library demo / usage in AIX

    richard wrote:

    > Hi,
    >
    > Anyone knows a sample source code that demonstrates curses library in
    > AIX (I'm currently using AIX 5L 5.3). In brief, I just wanted to
    > display a text (echoing) using a color (e.g.: blue, green, etc.).
    > Please, I couldn't find it by search engine.
    >
    > Thanks In Advance,


    Here you go - should work on AIX, it's about 15 years old, and it still
    works on Solaris.

    Cheers,
    Gary B-)

    --
    __________________________________________________ ____________________________
    Armful of chairs: Something some people would not know
    whether you were up them with or not
    - Barry Humphries

    #include

    main()
    {
    int i, x, y, c;
    short f, b;

    initscr();
    if (start_color() != OK) {
    mvaddstr(20, 0, "I don't have color!!!");
    refresh();
    goto endit;
    }
    noecho();
    nonl();
    cbreak(); /* !! */
    clear();
    erase();
    for (c = 0, x = 0; x < 8; x++)
    for (y = 0; y < 8; y++) {
    init_pair((short)c, (short)x, (short)y);
    ++c;
    }

    mvaddstr (2, 1, "All the colours of the rainbow...");
    move (4, 0);
    for (c = 1; c < 128; c++) {
    attrset (COLOR_PAIR(c));
    printw ("% 4d", c);
    attrset(A_NORMAL);
    addch (' ');
    }
    refresh();

    x = y = 1;

    getch();
    endit:
    endwin();
    }


  3. Re: Asking for a sample curses library demo / usage in AIX

    Gary, Big Thanks, Buddy!
    ^_^

    Best Regards,

    Richard.

    On Jul 13, 9:17 pm, "Gary R. Schmidt" wrote:
    >
    > Here you go - should work on AIX, it's about 15 years old, and it still
    > works on Solaris.
    >
    > Cheers,
    > Gary B-)
    >
    > --
    > __________________________________________________ ____________________________
    > Armful of chairs: Something some people would not know
    > whether you were up them with or not
    > - Barry Humphries



+ Reply to Thread