Re: [AD] allegro_message under X

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


On Sun, 24 Oct 2004 02:46:16 +0200, Elias Pschernig <allefant@xxxxxxxxxx> wrote:
> >
> > Hmm, kdialog makes a huge difference on my system, it not just the OK
> > button :-) But it seems bare x apps such as xmessage look abnormally ugly on
> > my system. So I agree it's best to just always use xmessage.
> >
> 
> Well, I don't know.. here, there's not much difference.

Why not just use the Xlib to print it? You shouldn't rely on external
programs being present, especially for such a function that can have
drasticly different behavior depending on its method of output.

> > Here is another patch, to use instead of the previous one. This time only
> > xmessage is tried, and I added a few more command line options to allow
> > closing the dialogs with ENTER.
> 
> Ah, very nice. Having to click could have been annoying, e.g. with
> things like exbitmap.

I tend to use allegro_message sparingly for the sole reason that the
behavior is different on seperate platforms. On Windows you get an
intrusive dialog box that you have to click OK on before the program
continues. On any other platform, you get a messge printed to stdout
that doesn't block the program at all.

> Well, of course the window could be made invisible.. but that would be
> confusing to users. They see the desktop, and still input goes to the
> invisible Allegro program.

I found this problem through first-hand experience. It was not fun
trying to find a work-around.

> Allegro doesn't guarantee that you can get
> input without having set a gfx mode - I believe it is just the same in
> Windows. Of course, something like: set_gfx_mode (GFX_TEXT);
> allegro_message ("Bla"); set_gfx_mode (GFX_AUTODETECT); should work,
> and you should automagically start receiving input again.. just as
> long as you are in GFX_TEXT, you get no input.

Except, with a method like that you could very well miss the message
completely.. depending on the platform. It could print to stdout but
immediately be lost by the next function call. And you can't manually
wait for a key press because that'd be annoying to Windows users (who
would have to click OK then hit Enter), and it wouldn't work on
platforms where you can't get input without the gfx mode active.

IMHO, allegro_message is a really messy function with limited use.

- Kitty Cat




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/