alandefreitas / matplotplusplus

Matplot++: A C++ Graphics Library for Data Visualization 📊🗾
https://alandefreitas.github.io/matplotplusplus/
MIT License
4.33k stars 333 forks source link

Prevent console window to open in GUI applications on Windows #377

Closed geral-victor closed 1 year ago

geral-victor commented 1 year ago

Fix for https://github.com/alandefreitas/matplotplusplus/issues/376

On Windows, in a GUI app using this library, a console window gets opened when using _popen. It seems (SO reference here) that the only way to avoid this is to use CreateProcess.

The use case that this PR fixes is when you want to use the lib in a GUI app on Windows, to generate figures that you save into files. I think that is what is called non-interactive mode.

geral-victor commented 1 year ago

I am transferring the functions to matplot::detail, and I will update the PR soon following your suggestion. In regards to the interactive mode, it seems to work fine on my end with this modification, but it's not the main mode I use.

alandefreitas commented 1 year ago

Nice

alandefreitas commented 1 year ago

Thanks ! :)