osdialog on windows
antoniograzioli opened this issue · 6 comments
I am creating a sampler module for VCV Rack. On Mac I succesffully created a simple button that opens a "open file" dialog (using osdialog) and loads a wav file in a sampler...
The same exact code, compiles correctly on Windows, but doesn't open any "open file" dialog...
here's part of the code:
void OpenWave() {
char *filename = osdialog_file(OSDIALOG_OPEN, NULL, NULL, NULL);
if (filename) {
filepath=filename;
printf("%s\n", filepath.c_str());
free(filename);
}
else {
printf("Canceled\n");
}
}
Can you run make ARCH=win
and ./test
in the osdialog directory? Does it open then?
i have run make ARCH=win but not "./test".
Yes, "./test" works so it might be something else in the code...I'll check the "trigger" button that uses the OpenWave function....
the strange think is that it works 100% on my mac...compiles on windows but does nothing
Maybe put a print statement above the call to osdialog to make sure it's being called at all?
Another thing to look out for is that Windows/MSYS2 doesn't flush buffers automatically on newline, so it could be printing but just not flushed. Add a fflush(stdout)
at the end maybe?
If you can't figure it out, post your code in the Rack repo and I'll take a look.
OK right, this is not a Osdialog issue...