Ignore:
Timestamp:
Nov 14, 2006, 12:33:49 AM (13 years ago)
Author:
Sam Hocevar
Message:
  • Implemented caca_set_display_title() for ncurses and S-Lang.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libcaca/trunk/caca/driver_ncurses.c

    r1333 r1391  
    6060static void ncurses_check_terminal(void);
    6161#endif
     62static void ncurses_set_title(char const *);
    6263static void ncurses_write_utf32(uint32_t);
    6364
     
    110111#endif
    111112
     113    ncurses_set_title("caca for ncurses");
     114
    112115    initscr();
    113116    keypad(stdscr, TRUE);
     
    167170static int ncurses_end_graphics(caca_display_t *dp)
    168171{
     172    ncurses_set_title("");
    169173    mousemask(dp->drv.p->oldmask, NULL);
    170174    curs_set(1);
     
    179183static int ncurses_set_display_title(caca_display_t *dp, char const *title)
    180184{
    181     return -1;
     185    ncurses_set_title(title);
     186
     187    return 0;
    182188}
    183189
     
    430436#endif
    431437
     438static void ncurses_set_title(char const *str)
     439{
     440    fprintf(stdout, "\x1b]0;%s\x07\n", str);
     441    fflush(stdout);
     442}
     443
    432444static void ncurses_write_utf32(uint32_t ch)
    433445{
Note: See TracChangeset for help on using the changeset viewer.