MessageBox after SDL_Quit

This is a good idea. Like the rest of SDL, wouldn’t this need to be
written for each platform? Windows could obviously be a dialog box, and
X11 could use the window manager and have a basic button … DirectFB
would have write everything (as there’s no standard widget set and no
window manager) …

But for submitting a patch to add this, would you want the code for all
platforms in one patch or would you accept patches that added support
only for one platform?On Tue, 2002-05-14 at 10:04, Sam Lantinga wrote:

SDL currently doesn’t provide a way to do this portably.
But do the functions for outputting messages portably belong to SDL?
I think yes because SDL, as a multimedia library, serves as a basic
interface between user and program.

I would be very happy to see this in SDL, some simple functions for giving
the user information (such as errors).

You know, lots of people have asked for this, but nobody has actually
written any robust method for doing this. I’m not opposed to adding it
to SDL 2.0, but it would sure help if somebody actually submitted code.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Chris
@Christopher_Thielen

Please don’t make this happen a lot – dialog boxes are ugly.On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to be
written for each platform? Windows could obviously be a dialog box, and


Matthew Miller @Matthew_Miller http://www.mattdm.org/
Boston University Linux ------> http://linux.bu.edu/

Right. IMHO, this feature should be a last resort if the application
fails to set up a display through SDL - nothing else.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 15 May 2002 03:05, Matthew Miller wrote:

On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to be
written for each platform? Windows could obviously be a dialog box,
and

Please don’t make this happen a lot – dialog boxes are ugly.

Best would be that the messages would occur automatically in places
that there is no other way to give the information to the enduser. This
means that video initialization failure would produce alert window. The
possibility to set the displayed text would be quite usefull though.On 2002.05.15 04:50 David Olofson wrote:

On Wednesday 15 May 2002 03:05, Matthew Miller wrote:

On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to
be

written for each platform? Windows could obviously be a dialog
box,

and

Please don’t make this happen a lot – dialog boxes are ugly.

Right. IMHO, this feature should be a last resort if the application
fails to set up a display through SDL - nothing else.

(for setting the text per error)

SDL_SetMessage(“Please e-mail the file error.log to
developer at project.com”, SDL_PARACHUTE_ERROR | SDL_UNKNOWN_ERROR);

so then, some crash would make that message to come up?

or

SDL_SetMessage(“Could not initalize video drivers.”, SDL_VIDEO_ERROR);

for not being able to set up video?

what’s a good function prototype for this? (this one is kinda ugly)
should there be a way to flag what error message goes with which
error(s), like video init or input init?On Tue, 2002-05-14 at 19:59, Sami N??t?nen wrote:

On 2002.05.15 04:50 David Olofson wrote:

On Wednesday 15 May 2002 03:05, Matthew Miller wrote:

On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to
be

written for each platform? Windows could obviously be a dialog
box,

and

Please don’t make this happen a lot – dialog boxes are ugly.

Right. IMHO, this feature should be a last resort if the application
fails to set up a display through SDL - nothing else.

Best would be that the messages would occur automatically in places
that there is no other way to give the information to the enduser. This
means that video initialization failure would produce alert window. The
possibility to set the displayed text would be quite usefull though.


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Chris
@Christopher_Thielen

Well, the default thing should be to print to stderr IMO, and for those
platforms which it does not make sense, we should add the GUI message
boxes. Win32 I have code for. MacOS/OS X I don’t, but would greatly
appreciate. Same for BeOS and others. My code is PD, but I will gladly
have Sam incorporate it into a future version of SDL.

The best practice is not to try and implement any part of a UI in SDL,
since that functionality does not belong there IMO. It is needed though
because of error messages and the like. Hence stderr is a good base for
this sort of thing, and the GUI message boxes should be provided on the
OSes for which it makes sense. Linux is not (currently) one of these, but
just about everything else not UNIXlike probably needs it these days.On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to be
written for each platform? Windows could obviously be a dialog box, and
X11 could use the window manager and have a basic button … DirectFB
would have write everything (as there’s no standard widget set and no
window manager) …

But for submitting a patch to add this, would you want the code for all
platforms in one patch or would you accept patches that added support
only for one platform?


Joseph Carter Crazy in the coconut

I’m sorry if the following sounds combative and excessively personal,
but that’s my general style. – Ian Jackson

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020515/99d7fb05/attachment.pgp

I think you can use MessageBox from Win32 API, /usr/bin/xmessage or gmessage
in Linux and /bin/alert in BeOS for example…

Have a nice day, Pavel Kanzelsberger> ----- Original Message -----

From: Joseph Carter [mailto:knghtbrd@bluecherry.net]
Sent: Tuesday, May 14, 2002 11:03 PM
To: sdl at libsdl.org
Subject: Re: [SDL] MessageBox after SDL_Quit

On Tue, May 14, 2002 at 06:05:02PM +0100, James wrote:

| I would be very happy to see this in SDL, some simple functions for
| giving the user information (such as errors).

How would these work on targets that don’t have the concept of a
"window"? Like the SVGAlib, directfb(?) or PDAs?

For targets that cannot use stderr effectively, a GUI messagebox for error
messages is highly appropriate. I have something like this I will be
putting up on a page in a few days with a few other useful SDL snippets like
my gen 3 DynGL code. (Note, I expect gen 3 to be the final generation of
this code prior to OpenGL 2.0’s widespread adoptance…)

I suppose if the backend handed the actual display of a
"SDL_MessageBox" or whatever, then all would be well :slight_smile:

I’m calling it SDL_SL_ErrorMsg (), intended for fatal error messages, called
just before SDL_Quit () (or just after, as you like it…)

Um, anyone here happen to use emacs? I need a cmode tag for a 4 space hard
tab indent, equiv of ft=c ts=4 sw=4 in vim… Advice welcome.


Joseph Carter Available in cherry and grape

Guns don’t kill people. It’s those damn bullets. Guns just make them go
really really fast.
– Jake Johanson

No. The calling application should decide when a message box is to be
displayed. It should be possible to try setting a video mode and then fall
back to something else if it fails.

To give the end user extended information, you should include the output from
SDL_GetError() in the message box (e.g. use sprintf to format a message).

cu,
NicolaiAm Mittwoch, 15. Mai 2002 04:59 schrieb Sami N??t?nen:

Right. IMHO, this feature should be a last resort if the application
fails to set up a display through SDL - nothing else.

Best would be that the messages would occur automatically in places
that there is no other way to give the information to the enduser. This
means that video initialization failure would produce alert window. The
possibility to set the displayed text would be quite usefull though.

You really should not be forking off processes like that to display an
error message. In Linux, stderr is sufficient because stderr is useful.
In BeOS it’s debatable. In Win32, MessageBox is the correct course of
action.On Wed, May 15, 2002 at 12:58:05PM +0200, Kanzelsberger Pavel wrote:

I think you can use MessageBox from Win32 API, /usr/bin/xmessage or gmessage
in Linux and /bin/alert in BeOS for example…


Joseph Carter Not many fishes

mariab - don’t think Debian hasn’t had some very stupid and
obvious bugs before
of course, we usually fix ours BEFORE we release =D

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020515/cc1e7e0b/attachment.pgp

Yes you’re right, but I didn’t find any better solution to display
MessageBox in Linux (if you don’t want to link to KDE or GTK libraries
ofcourse). Maybe X-Server supports something usefull like MessageBox in
Win32 API…

Regards, Pavel Kanzelsberger> ----- Original Message -----

From: Joseph Carter [mailto:knghtbrd@bluecherry.net]
Sent: Wednesday, May 15, 2002 3:04 PM
To: sdl at libsdl.org
Subject: Re: [SDL] MessageBox after SDL_Quit

On Wed, May 15, 2002 at 12:58:05PM +0200, Kanzelsberger Pavel wrote:

I think you can use MessageBox from Win32 API, /usr/bin/xmessage or
gmessage in Linux and /bin/alert in BeOS for example…

You really should not be forking off processes like that to display an error
message. In Linux, stderr is sufficient because stderr is useful. In BeOS
it’s debatable. In Win32, MessageBox is the correct course of action.


Joseph Carter Not many fishes

mariab - don’t think Debian hasn’t had some very stupid and
obvious bugs before
of course, we usually fix ours BEFORE we release =D

Well I was not talking about video mode failing, but the initialization
of SDL video subsystem. If this hapens the program does not have any
system independent way to display messages unless the program is
started from console of some kind. All other kind of error messages and
stuff should be handled by the programmer and not by SDL trying to
figure out what the programmer would like to do in this situation. The
reason for this way is that if that faital error messaging system isn’t
automatic there will be programs that will use the error messaging
capability for other purposes or that some wouldn’t use it at all.On 2002.05.15 14:19 Nicolai Haehnle wrote:

Am Mittwoch, 15. Mai 2002 04:59 schrieb Sami N??t?nen:

Right. IMHO, this feature should be a last resort if the
application

fails to set up a display through SDL - nothing else.

Best would be that the messages would occur automatically in places
that there is no other way to give the information to the enduser.
This
means that video initialization failure would produce alert window.
The
possibility to set the displayed text would be quite usefull though.

No. The calling application should decide when a message box is to be
displayed. It should be possible to try setting a video mode and then
fall
back to something else if it fails.

To give the end user extended information, you should include the
output from
SDL_GetError() in the message box (e.g. use sprintf to format a
message).

I think there should be predefined messages in english, which just
inform what went wrong. Also the amount of different possible fatal
errors should be kept in minimum. Because this error system IMHO is not
meant for debug tool (stderr is for that), but to inform end users that
there is really big problems, and possibly tell the user where to find
more information and help. This kind of system is more than suffisient
(I mean the possibility to set the error message texts) for the purpose
it is needed.On 2002.05.15 06:47 Chris wrote:

(for setting the text per error)

SDL_SetMessage(“Please e-mail the file error.log to
developer at project.com”, SDL_PARACHUTE_ERROR | SDL_UNKNOWN_ERROR);

so then, some crash would make that message to come up?

or

SDL_SetMessage(“Could not initalize video drivers.”, SDL_VIDEO_ERROR);

for not being able to set up video?

what’s a good function prototype for this? (this one is kinda ugly)
should there be a way to flag what error message goes with which
error(s), like video init or input init?

Most of the error messages used will be those from SDL_GetError (or your
own), so that’s probably reasonable enough. If you’re using gettext, you
can translate these messages as you see them (or rather your users can,
and send you the translations…)

I tend NOT to use gettext in games, bloat and code independence. I’ve not
heard many complaints actually, though several people have commented they
would appreciate it if we supported their native character sets in the
console. Neither might do this, if we can do it sanely. Unicode is a big
thing and texture fonts for it are massive. We’ll have to use font tiles
for individual pages or so.On Wed, May 15, 2002 at 10:28:16PM +0300, Sami N??t?nen wrote:

I think there should be predefined messages in english, which just
inform what went wrong. Also the amount of different possible fatal
errors should be kept in minimum. Because this error system IMHO is not
meant for debug tool (stderr is for that), but to inform end users that
there is really big problems, and possibly tell the user where to find
more information and help. This kind of system is more than suffisient
(I mean the possibility to set the error message texts) for the purpose
it is needed.


Joseph Carter I N33D MY G4M3Z, D00D!!!111!!
(Just … don’t ask)

I’d been hearing all sorts of gloom and doom predictions for Y2K, so I
thought I’d heed some of the advice that the experts have been giving:
Fill up the car’s gas tank, stock up on canned goods, fill up the bathtub
with water, and so on.

I guess I wasn’t fully awake when I completed my preparations late last
night. This morning I found the kitchen shelves soaked in gasoline, water
in the car’s gas tank, and my bathtub filled with baked beans.
– Dan Pearl in a message to rec.humor.funny

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020515/f42a1ff6/attachment.pgp

It’s really not necessary for Linux because you’ve got a usable way to
read stderr, even if you start your program from some launcher like KDE or
Gnome (~/.xsession-errors or equivalent)

It would not be unreasonable, though, since you already have the
dependency on libXt to write up a small xmessage-alike in raw X protocol
and display that. This is not fun and the number of people with skill
enough to do it anymore isn’t real high for obvious reasons. It’s not too
much work though, if someone’s willing and able to do it. I don’t see the
need, however.

stderr for FB and svgalib are about all you can hope for though. In the
former case, it will just work and be drawn over your graphics in most
cases. In the latter, you will either be able to read stderr or not be
able to do anything but reboot to get your console back.On Wed, May 15, 2002 at 03:41:39PM +0200, Kanzelsberger Pavel wrote:

Yes you’re right, but I didn’t find any better solution to display
MessageBox in Linux (if you don’t want to link to KDE or GTK libraries
ofcourse). Maybe X-Server supports something usefull like MessageBox in
Win32 API…


Joseph Carter Sanity is counterproductive

  • Knghtbrd wonders what his 18 hour download will break
    It includes glibc, X, python, gcc, and the Debian tools…
    Which means with my luck it will break glibc, X, python, gcc,
    and the Debian tools…

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020515/b21dee6c/attachment.pgp

what’s a good function prototype for this? (this one is kinda ugly)
should there be a way to flag what error message goes with which
error(s), like video init or input init?

I think there should be predefined messages in english, which just
inform what went wrong.

Oh no… Some of us would like the game to be localized to different
languages. I rather decide for what text to write myself.

Also the amount of different possible fatal
errors should be kept in minimum. Because this error system IMHO is not
meant for debug tool (stderr is for that), but to inform end users that
there is really big problems, and possibly tell the user where to find
more information and help. This kind of system is more than suffisient
(I mean the possibility to set the error message texts) for the purpose
it is needed.

If I want to show a error message and then want to tell the user he can
contact my support person (myself anyway), then it does not work that well
with predefined messages.

-Sam

If dialog boxes are a huge need in SDL (there were many requests for it
right?) then I’m sure we could easily find somebody to write the code
for each API (X11, Win32, MacOS, etc.). MacOS and Win32 programmers
always know about the common dialog box function (unless they’re in the
middle of learning the API) and X11 programmers are dropping (widget
sets are a more reasonable thing to learn to make graphical apps) but
they still exist.On Wed, 2002-05-15 at 13:41, Joseph Carter wrote:

It would not be unreasonable, though, since you already have the
dependency on libXt to write up a small xmessage-alike in raw X protocol
and display that. This is not fun and the number of people with skill
enough to do it anymore isn’t real high for obvious reasons. It’s not too


Chris
@Christopher_Thielen

Dialog boxes have no place in SDL.

The problem is that we need them for error reporting on some OSes. It’s
not difficult to add them for this purpose, and I would not object to
SDL_PostError which takes a string and does the most appropriate thing
with it (stderr or a dialog box…)

I’m not a Win32 coder, but I have written the code for it because those
users need it. MacOS X is another platform we support, and they could
benefit, but if push comes to shove they HAVE stderr. I’m still getting
caught up here though - I just spent a week and a half in the hospital
after all. When I’m finished catching up, I’ll put what I have on a web
page I’ve been preparing for a bunch of useful things like that and my
generation 3 DynGL code.On Wed, May 15, 2002 at 04:08:46PM -0700, Chris wrote:

It would not be unreasonable, though, since you already have the
dependency on libXt to write up a small xmessage-alike in raw X protocol
and display that. This is not fun and the number of people with skill
enough to do it anymore isn’t real high for obvious reasons. It’s not too

If dialog boxes are a huge need in SDL (there were many requests for it
right?) then I’m sure we could easily find somebody to write the code
for each API (X11, Win32, MacOS, etc.). MacOS and Win32 programmers
always know about the common dialog box function (unless they’re in the
middle of learning the API) and X11 programmers are dropping (widget
sets are a more reasonable thing to learn to make graphical apps) but
they still exist.


Joseph Carter We can hope for the future
But there might not be one

“I keep my personal gpg data in a locked, lead safe in a vault
guarded by angry rednecks and their dawgs. Trespassers will be
violated, and all that…”

-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 273 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20020515/c9eb98bc/attachment.pgp

This wouldn’t work, since an application doesn’t have to give up and
terminate just because SDL video init fails, for example. SDL cannot know
whether or not an application can handle an error condition, so in some
cases, you’d get a “critical error dialog” even though the application is
just about to try something else.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 15 May 2002 04:59, Sami N??t?nen wrote:

On 2002.05.15 04:50 David Olofson wrote:

On Wednesday 15 May 2002 03:05, Matthew Miller wrote:

On Tue, May 14, 2002 at 06:00:34PM -0700, Chris wrote:

This is a good idea. Like the rest of SDL, wouldn’t this need to

be

written for each platform? Windows could obviously be a dialog

box,

and

Please don’t make this happen a lot – dialog boxes are ugly.

Right. IMHO, this feature should be a last resort if the application
fails to set up a display through SDL - nothing else.

Best would be that the messages would occur automatically in places
that there is no other way to give the information to the enduser. This
means that video initialization failure would produce alert window. The
possibility to set the displayed text would be quite usefull though.

Problem is that it works only if you launch programs from the command
line, or explicitly tells your desktop environment to “run from
console”. For example, you won’t see any stdout output from an
application started the “normal” way under KDE or GNOME. It’s actually
worse than Win32, since there’s no standard place to look for the output
afterwards…

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 15 May 2002 15:03, Joseph Carter wrote:

In Linux, stderr is sufficient because stderr is
useful.

[…]

The
reason for this way is that if that faital error messaging system isn’t
automatic there will be programs that will use the error messaging
capability for other purposes or that some wouldn’t use it at all.

SDL cannot and shouldn’t try to “fix” crappy code.

Either way, some application may deliberately want to exit silently in
case of an error, and other applications may want to try another target
if SDL fails to initialize.

//David Olofson — Programmer, Reologica Instruments AB

.- M A I A -------------------------------------------------.
| Multimedia Application Integration Architecture |
| A Free/Open Source Plugin API for Professional Multimedia |
----------------------------> http://www.linuxdj.com/maia -' .- David Olofson -------------------------------------------. | Audio Hacker - Open Source Advocate - Singer - Songwriter |-------------------------------------> http://olofson.net -'On Wednesday 15 May 2002 21:18, Sami N??t?nen wrote: