bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with wide characters


From: Thomas Dickey
Subject: Re: problems with wide characters
Date: Mon, 15 Jun 2009 18:53:32 -0400
User-agent: Mutt/1.5.18 (2008-05-17)

On Mon, Jun 15, 2009 at 06:25:10PM -0400, Ruben Pollan wrote:
> #include <ncursesw/ncurses.h>
> #include <wchar.h>
> #include <stdio.h>

#include <locale.h>

> int main()
> {

        setlocale(LC_ALL, "");

>       initscr();
>       clear();
>       echo();
>       keypad(stdscr, TRUE);
>       cbreak();
>       curs_set(1);
>       refresh();
> 
>       wint_t ch = L'\0';
>       wchar_t str[32];
>       int i = 0;
>       while ((i < 32) && (ch != L'q'))
>       {
>               move (0,0);
>               get_wch(&ch);

you're not checking the return value here (just in case...)

>               str[i] = ch;
>               i++;
>               str[i] = L'\0';
>               clear();
>               move (2, 0);
>               addwstr(L"string: ");
>               addwstr(str);
>               refresh();
>       }
> 
>       clear();
>       refresh();
>       endwin();
> }


-- 
Thomas E. Dickey <address@hidden>
http://invisible-island.net
ftp://invisible-island.net

Attachment: signature.asc
Description: Digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]