Skip to content

Conversation

Semphriss
Copy link
Contributor

I haven't seem much discussion about whether those dialogs should be added to SDL; I open this PR also as a discussion as to whether or not they should be, and which ones are relevant to SDL. I presumed it would be easier to discuss with working code available.

Description

This PR adds the following input dialogs types:

  • Text/password input
    image
  • Progress/loading bar
    image
  • Color picker
    image
  • Date picker
    image

These also seem to be available, but I'm not sure if they're globally useful:

  • List selection dialogs
    image
  • Scale number picker
    image

As of opening the PR, only the Zenity implementation is supported. I chose to open this PR early to get feedback on the current API.

Should I add the two remaining dialog types? More generally, which ones are good to add in SDL?

If some would be good to add:

  • Currently all dialogs take an SDL_PropertiesID argument; should I make a simple version for each, similarly to SDL_ShowSimpleMessageBox?
  • Should I re-use the same property field macros for fields that are similar across dialogs? (such as a single SDL_PROP_DIALOG_TITLE_STRING for all dialogs)
  • For the date picker, I did not re-use the existing SDL_DateTime struct because it seems to be a complete representation of a given timestamp (including the day of the week and the UTC offset), and I wasn't sure how to handle this. I probably should move the code to SDL_DateTime, but I would need guidance on how to design the API.

I should be able to take care of the Windows implementation, but I haven't yet gotten my hands on a new macOS device; help would be welcome.

Existing Issue(s)

Fixes #12792

@Semphriss Semphriss force-pushed the input-dialogs branch 3 times, most recently from 382292d to 8b32574 Compare June 9, 2025 13:45
@expikr
Copy link
Contributor

expikr commented Aug 31, 2025

Would it perhaps be more suited to a separate SDL-blessed library a la SDL_Image etc?

@slouken
Copy link
Collaborator

slouken commented Aug 31, 2025

Input seems useful in the core library, but the others are probably specific to particular use cases. @expikr's idea of a separate dialog specific library seems like a good one.

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 this pull request may close these issues.

Support for input dialogs
3 participants