summaryrefslogtreecommitdiff
path: root/testing/toxic/windows.c
diff options
context:
space:
mode:
authorManuel Argüelles <manuel.arguelles@gmail.com>2013-08-21 16:19:35 -0500
committerManuel Argüelles <manuel.arguelles@gmail.com>2013-08-21 16:19:35 -0500
commit93789396b16e0eaef7b0d540b2ff2a39b5a315ec (patch)
tree9749d56cf218408017c8341b1c7f28a1c3bb55a4 /testing/toxic/windows.c
parentd840e8a7430616bf96c164446f672d23b06cdfef (diff)
Add wide char support in toxic (issue #440)
Set current locale, use of get_wch instead of getch for reading, use wctomb and friends to convert back from wchar_t, link with cursesw. Unicode support is only added to chat windows.
Diffstat (limited to 'testing/toxic/windows.c')
-rw-r--r--testing/toxic/windows.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/testing/toxic/windows.c b/testing/toxic/windows.c
index 8fdf4e19..f50bdc2d 100644
--- a/testing/toxic/windows.c
+++ b/testing/toxic/windows.c
@@ -226,16 +226,18 @@ void draw_active_window(Messenger *m)
226{ 226{
227 227
228 ToxWindow *a = active_window; 228 ToxWindow *a = active_window;
229 wint_t ch = 0;
230
229 prepare_window(a->window); 231 prepare_window(a->window);
230 a->blink = false; 232 a->blink = false;
231 draw_bar(); 233 draw_bar();
232 a->onDraw(a, m); 234 a->onDraw(a, m);
233 235
234 /* Handle input */ 236 /* Handle input */
235 int ch = getch(); 237 get_wch(&ch);
236 238
237 if (ch == '\t' || ch == KEY_BTAB) 239 if (ch == '\t' || ch == KEY_BTAB)
238 set_next_window(ch); 240 set_next_window((int) ch);
239 else if (ch != ERR) 241 else if (ch != ERR)
240 a->onKey(a, m, ch); 242 a->onKey(a, m, ch);
241} 243}