Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to load the previously GUI saved state (locale problem) #78

Open
lilive opened this issue Aug 13, 2018 · 0 comments
Open

Fail to load the previously GUI saved state (locale problem) #78

lilive opened this issue Aug 13, 2018 · 0 comments
Labels
legacy-version For issues releated to the older legacy code, before all the refactorings in the develop branch.

Comments

@lilive
Copy link

lilive commented Aug 13, 2018

Hi,

I discovered a locale related problem when ImGui load the GUI configuration from the disk. I lose my windows positions and size everytime I start the app.

The problem is that ImGui parse the gui.ini file with the function sscanf, which in my case interpret the commas as numeric dots.

i.e.
Pos:60,10
is read as

x = 60.10
y = 0.0

instead of

x = 60.0
y = 10.0

I can fix it by adding:

#include <locale.h>
setlocale(LC_NUMERIC, "C");

in my ofApp.cpp, but this seems dirty to me.

I opened a topic about that in the forum: https://forum.openframeworks.cc/t/problem-with-locale-and-sscanf-ofximgui-related/30178

And this is the occasion to thank you for this addon !

@Daandelange Daandelange added the legacy-version For issues releated to the older legacy code, before all the refactorings in the develop branch. label Jul 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
legacy-version For issues releated to the older legacy code, before all the refactorings in the develop branch.
Projects
None yet
Development

No branches or pull requests

2 participants