static int l_uiMultilineEntryText( lua_State* L ) { char* s = uiMultilineEntryText( (uiMultilineEntry*) check_object( L, 1, uiMultilineEntrySignature ) ); lua_pushstring( L, s ); uiFreeText( s ); return 1; }
static Janet janet_ui_multiline_entry_text(int32_t argc, Janet *argv) { janet_arity(argc, 1, 2); uiMultilineEntry *me = janet_getuitype(argv, 0, &multiline_entry_td); if (argc == 2) { const uint8_t *text = janet_getstring(argv, 1); uiMultilineEntrySetText(me, (const char *)text); return argv[0]; } return janet_cstringv(uiMultilineEntryText(me)); }
static void callback_uiMultilineEntryOnChanged( uiMultilineEntry* c, void* d ) { lua_State* L = (lua_State*) d; if( L ) { char* str = uiMultilineEntryText( c ); lua_pushstring( L, str ); uiFreeText( str ); invoke_callback( L, c, callback_OnChanged, 1 ); } }