How do we request a feature to SDL?

I was wondering if this has been proposed to SDL1.3?

I would like to see a MessageBox() like win32 has to inform the user in a
GUI way that they have an error or any kind of message and allow a Ok,
Cancel, Retry button.

Is this possible to do with SDL? If so it would be great.

This would be better if it was just user-implemented. To add such a feature
to SDL would be silly, because not everyone would use it…it isn’t very
dynamic, if you know what i mean. There are some widget libraries that can
easily do message boxes without directly using the linux/windows api.
Sorry to burst your bubbleOn 5/12/07, Mars_999 wrote:

I was wondering if this has been proposed to SDL1.3?

I would like to see a MessageBox() like win32 has to inform the user in a
GUI way that they have an error or any kind of message and allow a Ok,
Cancel, Retry button?

Is this possible to do with SDL? If so it would be great.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

i was thinking the same thing. i have seen threads that suggest
guichan might be able to do what you want. but havent gotten around to
trying it yet. still working on my game core.

mattOn Sat, 12 May 2007 20:35:51 -0400 “Alex Barry” <alex.barry at gmail.com> wrote:

This would be better if it was just user-implemented. To add such a
feature to SDL would be silly, because not everyone would use it…it
isn’t very dynamic, if you know what i mean. There are some widget
libraries that can easily do message boxes without directly using the
linux/windows api. Sorry to burst your bubble

On 5/12/07, Mars_999 wrote:

I was wondering if this has been proposed to SDL1.3?

I would like to see a MessageBox() like win32 has to inform the
user in a GUI way that they have an error or any kind of message
and allow a Ok, Cancel, Retry button?

Is this possible to do with SDL? If so it would be great.

Alex Barry wrote:

This would be better if it was just user-implemented. To add such a
feature to SDL would be silly, because not everyone would use it…it
isn’t very dynamic, if you know what i mean. There are some widget
libraries that can easily do message boxes without directly using the
linux/windows api.
Sorry to burst your bubble

I always thought this would be a nice little standalone library with one
public API:

 void SDL_msgbox(const char *title, const char *text);

(maybe extra credit for adding a way to do “yes/no” or "ok/cancel"
instead of just “ok”.)

The problems I ran into last time I considered this:

  1. Mac is easy, Windows is easy. What do you do with Linux? Add a GTK+
    dependency just to pop up a message box? Roll your own in Xlib that
    doesn’t match the user’s theme?

  2. What do you do for targets without a window system? What does fbcon
    use for a message box, when there’s no window kit and you can’t even
    read stdout? Do you roll your own and write to the framebuffer? If so,
    do you pull in freetype as a dependency to put text to the screen? What
    if the user is using SDL_OPENGL?

  3. What do you do when you have SDL running a fullscreen video mode?
    Drop back to a window to show the message box?

I couldn’t find a clean way to do this cross-platform. I’d recommend you
either put the message box in your app’s UI in some form…the only time
you really want a system message box is when SDL_SetVideoMode() fails,
and that’s probably worth just #ifdef’ing it for platforms you care about:

#if WINDOWS
MessageBox(…);
#elif MACOSX
CreateStandardAlert(…);
#else
fprintf(stderr, “SDL_SetVideoMode() failed: %s\n”, SDL_GetError());
#endif

–ryan.

Thanks Ryan, I thought about doing what you suggested, and as I feared it’s
a nightmare for x-platform. I was hoping SDL would be able to accommodate
this. And as I feared with the multiple scenarios, OpenGL, windowed, and
fullscreen and with Vista now GDI and GL isn’t a good thing to have to deal
with.

I will see if Guichan will add this in…

Thanks Ryan, I thought about doing what you suggested, and as I
feared it’s a nightmare for x-platform. I was hoping SDL would be
able to accommodate this. And as I feared with the multiple
scenarios, OpenGL, windowed, and fullscreen and with Vista now GDI
and GL isn’t a good thing to have to deal with.

I will see if Guichan will add this in…

also, stderr should be available on all platforms i think. but the
user can not respond thats all. you can print display error and exit.
or display user info like what the display is running at.

mattOn Sat, 12 May 2007 22:57:02 -0500 “Mars_999” wrote:

I will see if Guichan will add this in…

like i said i havent used guichan yet, but it would be all in one
window, not a popup.

matt

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ryan C. Gordon schreef:

Alex Barry wrote:

This would be better if it was just user-implemented. To add such a
feature to SDL would be silly, because not everyone would use it…it
isn’t very dynamic, if you know what i mean. There are some widget
libraries that can easily do message boxes without directly using the
linux/windows api.
Sorry to burst your bubble

I always thought this would be a nice little standalone library with one
public API:

 void SDL_msgbox(const char *title, const char *text);

(maybe extra credit for adding a way to do “yes/no” or "ok/cancel"
instead of just “ok”.)

The problems I ran into last time I considered this:

  1. Mac is easy, Windows is easy. What do you do with Linux? Add a GTK+
    dependency just to pop up a message box? Roll your own in Xlib that
    doesn’t match the user’s theme?

GTK+ has a commandline utility called zenity, KDE has kdialog I believe,
X itself provides xmessage. It’s a bunch of options; ideally one would
be selected based on the current desktop, using an environment variable
perhaps, with xmessage as the fallback.

  1. What do you do for targets without a window system? What does fbcon
    use for a message box, when there’s no window kit and you can’t even
    read stdout? Do you roll your own and write to the framebuffer? If so,
    do you pull in freetype as a dependency to put text to the screen? What
    if the user is using SDL_OPENGL?

Isn’t it possible to just use SDL if the video component has already
been initialized? Rendering text would be difficult indeed, but if it’s
going to be an external library then I don’t see a problem in pulling in
freetype.

  1. What do you do when you have SDL running a fullscreen video mode?
    Drop back to a window to show the message box?

See above.

I couldn’t find a clean way to do this cross-platform. I’d recommend you
either put the message box in your app’s UI in some form…the only time
you really want a system message box is when SDL_SetVideoMode() fails,
and that’s probably worth just #ifdef’ing it for platforms you care about:

#if WINDOWS
MessageBox(…);
#elif MACOSX
CreateStandardAlert(…);
#else
fprintf(stderr, “SDL_SetVideoMode() failed: %s\n”, SDL_GetError());
#endif

That’s always been exactly the kind of thing SDL is supposed to prevent,
for me. A separate library for this sound okay, though.

  • – St?phan
    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFGRvxacFUq0gzqDwQRAkkEAKCFAyerUELiBOQjBQuj/E9dTwvJqwCfbXQs
4juL1N3sw6IyasuQSj9RjZE=
=hSUJ
-----END PGP SIGNATURE-----

St?phan Kochen schrieb:

I couldn’t find a clean way to do this cross-platform. I’d recommend you
either put the message box in your app’s UI in some form…the only time
you really want a system message box is when SDL_SetVideoMode() fails,
and that’s probably worth just #ifdef’ing it for platforms you care about:

#if WINDOWS
MessageBox(…);
#elif MACOSX
CreateStandardAlert(…);
#else
fprintf(stderr, “SDL_SetVideoMode() failed: %s\n”, SDL_GetError());
#endif

That’s always been exactly the kind of thing SDL is supposed to prevent,
for me. A separate library for this sound okay, though.

That is why I always keep os dependent funcionality in their own files
and then during compile
time pull the correct one.

Example:

dialog.h
dialog_win32.c
dialog_unix.c

Then no need to have preprocessor code all over the place.

Cheers,
Paulo

I was wondering if this has been proposed to SDL1.3?

I would like to see a MessageBox() like win32 has to inform the user
in a GUI way that they have an error or any kind of message and allow
a Ok, Cancel, Retry button?

Actually, this question/suggestion is a FAQ on this list. The answer is
that SDL 1.3 will support multiple windows on OSes that have window
systems. That means that on Linux, Mac OS, and Windows you will just be
able to create a new window and do what you want with it.

On systems that do not have a windowing system you will, of course, not
be able to do that.

	Bob PendletonOn Sat, 2007-05-12 at 18:28 -0500, Mars_999 wrote:

Is this possible to do with SDL? If so it would be great.


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

±-------------------------------------+