Re: [AD] allegro_message under X

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


On Sat, 2004-10-23 at 11:30 +0200, Julien Cugnière wrote:
> Under UNIX/linux, allegro_message() outputs to stdout no matter what. This 
> makes sense when using the console driver, but when running under X, this is 
> far from optimal. Just like in Windows, stdout might not be visible to the 
> user.
> 

I agree.

> That's why I would like to make allegro_message() display a dialog box under 
> X, if possible. The problem is that as I understand it, there is no universal 
> "MessageBox()" API like in Windows. I can see the following ways of 
> displaying a message box:
> 
>  1. use the command line utility kdialog (or gdialog) if available
>  2. use xdialog if available (maybe it is always available with X ?)

I have neither of the 3, with the standard debian gnome desktop. I have
"xmessage" though.

>  3. implement a message box using the X11 lib (ugh!)
> 

I don't think that's necessary, but it would be easy, just create a
window and put some text, like this:
http://freedesktop.org/cgi-bin/viewcvs.cgi/cvsup/xc/programs/xmessage/xmessage.c?view=markup

But using xmessage directly should work just as well.

> kdialog and gdialog are nice because they follow KDE's/Gnome's look and feel.
> 
> If the idea seems good, I can have a go at implementing it. There are just a 
> few issues:
> 
>  A. I know nothing about the X11 lib, so I won't use it :-) I'm not sure it's 
> a good idea anyway.
>  B. what's the best way to check for the existence of a command ? Try to run 
> it with system("kdialog...") and check the return status ?

Sounds like a good way to me.

>  C. if both kdialog and gdialog are available, is there a fool-proof way to 
> know what Desktop Environment the user is currently running ?
> 

I don't know. Maybe we should just use a config entry, so users can
override it.

Oh, and what happens in fullscreen mode?

-- 
Elias Pschernig





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