Skip to content

SDL_PROP_FILE_DIALOG_ACCEPT_STRING and SDL_PROP_FILE_DIALOG_CANCEL_STRING not working on windows #12801

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

Open
OldSnake22 opened this issue Apr 11, 2025 · 3 comments · May be fixed by #12979
Open
Milestone

Comments

@OldSnake22
Copy link

Hello,

When I set the SDL_PROP_FILE_DIALOG_ACCEPT_STRING property or SDL_PROP_FILE_DIALOG_CANCEL_STRING property with the SDL_ShowFileDialogWithProperties() function, those properties seems to do nothing, nothing is changed. Everything else is working correctly.

On windows at least. Is this a normal behavior for the windows platform ?

Regards

@slouken
Copy link
Collaborator

slouken commented Apr 11, 2025

@Semphriss?

@slouken slouken added this to the 3.2.12 milestone Apr 11, 2025
@Semphriss
Copy link
Contributor

Renaming the OK/Cancel buttons is not supported on Windows through the OPENFILENAMEW struct, which SDL currently uses. Generally, cosmetic options are only supported on the platforms that support it. For instance, macOS supports customizing the OK button, but not the Cancel button, and I'm not aware of any workaround.

I believe there has been suggestions to move to IFileDialog, which (among other things) seem to support customizing button labels (IFileDialog2 required for the Cancel button). This would fix this problem on Windows, but keep in mind that other systems may not support all options.

I'm not very familiar with IFileDialog and the principles of modern Windows programming within SDL, and I already informally assigned myself a number of tasks for SDL, so I'm tempted to leave the implementation to somebody else for now. If nobody picks it up, I can give it a try later.

@slouken slouken modified the milestones: 3.2.12, 3.x Apr 23, 2025
@Semphriss Semphriss linked a pull request May 7, 2025 that will close this issue
@Semphriss
Copy link
Contributor

I ended up giving it a try and opened #12979, which implements both missing properties.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants