openframeworks / openFrameworks

openFrameworks is a community-developed cross platform toolkit for creative coding in C++.
http://openframeworks.cc
Other
9.94k stars 2.55k forks source link

ofDragInfo issue #7916

Open Jonathhhan opened 5 months ago

Jonathhhan commented 5 months ago

I have an error with ofDragInfo when I try to make Lua bindings in ofxLua:

No operand found that accepts an operand of type std::vector<std::string,std::allocator<std::string>> on the right.

If I replace of::filesystem::path with std::string at line 111 in ofEvents.h it works (maybe better to replace std::string with of::filesystem::path instead?):

//-----------------------------------------------
class ofDragInfo {
public:
    std::vector<of::filesystem::path> files;
    glm::vec2 position;
};
//-----------------------------------------------
class ofDragInfo {
public:
    std::vector<std::string> files;
    glm::vec2 position;
};
dimitre commented 5 months ago

I would try to edit ofxLua bindings, maybe something like this:

      SWIG_fail_ptr("DragInfo_files_set",2,SWIGTYPE_p_std__vectorT_std__string_t); }  if (arg1) (arg1)->files = *arg2;
    return SWIG_arg; fail: SWIGUNUSED; }  lua_error(L); return 0; }
dimitre commented 5 months ago

cc @danomatika