static int lua_AddButton(lua_State *L) { if (lua_type(L, 1) != LUA_TTABLE) { lua_pushlightuserdata(L, 0); return 1; } mir_ptr<TTBButton> tbb(MakeTBButton(L)); HANDLE res = ::TopToolbar_AddButton(tbb); lua_pushlightuserdata(L, res); return 1; }
static int lua_AddButton(lua_State *L) { if (lua_type(L, 1) != LUA_TTABLE) { lua_pushlightuserdata(L, 0); return 1; } TTBButton* tbb = MakeTBButton(L); HANDLE res = ::TopToolbar_AddButton(tbb); lua_pushlightuserdata(L, res); if (res != INVALID_HANDLE_VALUE) TBButtons.insert(res); mir_free(tbb->name); mir_free(tbb->pszTooltipUp); mir_free(tbb->pszTooltipDn); mir_free(tbb); return 1; }