From 813d295e8a453fccaf5b7acfb55c7c07388bf731 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Thu, 23 Apr 2009 15:32:19 +0000 Subject: Fixed Fl_Input_::index(int) to return a UCS4 character instead of a byte. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6777 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- test/input.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test') diff --git a/test/input.cxx b/test/input.cxx index 8fb9f214f..17534c812 100644 --- a/test/input.cxx +++ b/test/input.cxx @@ -52,6 +52,10 @@ void toggle_cb(Fl_Widget *o, long v) { void test(Fl_Input *i) { if (i->changed()) { i->clear_changed(); printf("%s '%s'\n",i->label(),i->value()); + char utf8buf[10]; + int last = fl_utf8encode(i->index(i->position()), utf8buf); + utf8buf[last] = 0; + printf("Symbol at cursor position: %s\n", utf8buf); } } -- cgit v1.2.3