libsdl-org / sdlwiki

This is the raw contents of SDL's wiki. You can edit this through GitHub or at https://wiki.libsdl.org/ now!
https://wiki.libsdl.org/
79 stars 32 forks source link

Add example code for dialog filter and callback #528

Closed Semphriss closed 3 months ago

Semphriss commented 3 months ago

Replaces https://github.com/libsdl-org/SDL/pull/9729, the same description applies.

This is my first PR here, please let me know if I got something wrong!

icculus commented 3 months ago

This looks good. I'm adding this and then fixing the syntax error.

icculus commented 3 months ago

Okay, make sure I didn't screw this up in 3a5ce94d54dba2268d86c2257fd73d9b2ec1b366.

(Outside of this specific example: should this callback send in the filter array too, so we don't have to have a global to figure out what the filter argument is referring to? Let me know if I should open an issue about it.)

Semphriss commented 3 months ago

I reviewed the commit and everything looked fine.

One thing though, there are still \n's with SDL_Log in test/testdialog.c, should they be removed too?

slouken commented 3 months ago

SDL_Log messages should be terminated with "\n"