X-Git-Url: https://git.jsancho.org/?p=guile-irrlicht.git;a=blobdiff_plain;f=src%2Fgui-toolbar.cpp;h=134081691d57de16018e74b3a994383a82ca624e;hp=997de689b6cc1ac84e3584fb7c3bd320c2189ef4;hb=3bb58c2b45af12c0f9c9eac648e67ac6fa90e104;hpb=41a6ad96e81a8d8153c54877c4c12f61100677a9 diff --git a/src/gui-toolbar.cpp b/src/gui-toolbar.cpp index 997de68..1340816 100644 --- a/src/gui-toolbar.cpp +++ b/src/gui-toolbar.cpp @@ -23,7 +23,7 @@ #include #include "gsubr.h" #include "gui-toolbar.h" -#include "wchar.h" +#include "wrapped.h" using namespace irr; @@ -37,16 +37,22 @@ IGUIToolBar_addButton (SCM gui_toolbar, SCM is_push_button, SCM use_alpha_channel) { - gui::IGUIToolBar* toolbar = (gui::IGUIToolBar*) scm_to_pointer (gui_toolbar); + gui::IGUIToolBar* toolbar = (gui::IGUIToolBar*) scm_to_irr_pointer (gui_toolbar); + wchar_t* wtext = (wchar_t*) scm_to_utf32_string (text); + wchar_t* wtooltiptext = (wchar_t*) scm_to_utf32_string (tooltiptext); + gui::IGUIButton* button = toolbar->addButton (scm_to_int32 (id), - scm_to_wide_char_string (text), - scm_to_wide_char_string (tooltiptext), - (video::ITexture*) scm_to_pointer (img), - (video::ITexture*) scm_to_pointer (pressedimg), + wtext, + wtooltiptext, + (video::ITexture*) scm_to_irr_pointer (img), + (video::ITexture*) scm_to_irr_pointer (pressedimg), scm_to_bool (is_push_button), scm_to_bool (use_alpha_channel)); - return scm_from_pointer ((void*) button, NULL); + + free (wtext); + free (wtooltiptext); + return scm_from_irr_pointer ("", (void*) button); } void