fenster können erstellt werden

This commit is contained in:
2024-12-14 00:37:16 +01:00
parent 7509ebde48
commit e1a359071e
4 changed files with 6 additions and 3 deletions

View File

@@ -49,7 +49,7 @@ file(GLOB_RECURSE SOURCES "src/*.cpp" "inc/*.h")
add_executable(Toolbox main.cpp ${SOURCES} ${RESOURCE_FILES} ${PLATFORM_SOURCES})
target_include_directories(${PROJECT_NAME} PRIVATE "out_embed")
target_link_libraries(Toolbox PRIVATE saucer::saucer sol2::sol2 tray nlohmann_json cppcodec fltk::fltk moonfltk lua)
target_link_libraries(Toolbox PRIVATE saucer::saucer sol2::sol2 tray nlohmann_json cppcodec fltk moonfltk lua)
if(WIN32 AND (CMAKE_BUILD_TYPE STREQUAL "Release" OR CMAKE_BUILD_TYPE STREQUAL "MinSizeRel"))
set_target_properties(Toolbox PROPERTIES WIN32_EXECUTABLE TRUE)

View File

@@ -261,10 +261,13 @@ void ToolboxWindow::run_lua(int id) {
try {
std::string scriptPath = m_toolboxItems[id].lua_script;
lua.script_file(scriptPath);
m_webview.execute("enableButtonByToolId({})",saucer::make_args(id));
m_webview.reload();
} catch (const sol::error& e) {
std::cerr << "Lua error: " << e.what() << std::endl;
m_webview.execute("enableButtonByToolId({})",saucer::make_args(id));
m_webview.reload();
}
};