X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=src%2Fgui-listbox.cpp;h=a839690c1034711cd93910f74c733514bdbaff3f;hb=79e12d94cc21232477796a4e76fc2ddb5d88f9dc;hp=e53ba49d0cb5139fdab0c04b766c585421cd6f22;hpb=41a6ad96e81a8d8153c54877c4c12f61100677a9;p=guile-irrlicht.git diff --git a/src/gui-listbox.cpp b/src/gui-listbox.cpp index e53ba49..a839690 100644 --- a/src/gui-listbox.cpp +++ b/src/gui-listbox.cpp @@ -23,7 +23,7 @@ #include #include "gui-listbox.h" #include "gsubr.h" -#include "wchar.h" +#include "wrapped.h" using namespace irr; @@ -32,17 +32,19 @@ IGUIListBox_addItem (SCM gui_listbox, SCM text, SCM icon) { - gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_pointer (gui_listbox); + gui::IGUIListBox* listbox = (gui::IGUIListBox*)scm_to_irr_pointer (gui_listbox); + wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); u32 item_id; if (icon == SCM_UNDEFINED) { - item_id = listbox->addItem (scm_to_wide_char_string (text)); + item_id = listbox->addItem (wtext); } else { - item_id = listbox->addItem (scm_to_wide_char_string (text), + item_id = listbox->addItem (wtext, scm_to_int32 (icon)); } + free (wtext); return scm_from_uint32 (item_id); }