Archived

This topic is now archived and is closed to further replies.

Message box using X

This topic is 5586 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When my game cannot find a certain file it needs to run, I want it to do a message box. I''m also trying to make it portable. I''m using compiler directives to do the appropriate message box depending on which OS it is compiled for. I have Windows nailed, but now I can''t figure out how to make X show a message box. is there an easy way, like MessageBox() in Windows? How do I do it?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
quote:
Original post by BradDaBug
When my game cannot find a certain file it needs to run, I want it to do a message box. I''m also trying to make it portable. I''m using compiler directives to do the appropriate message box depending on which OS it is compiled for.

I have Windows nailed, but now I can''t figure out how to make X show a message box.

is there an easy way, like MessageBox() in Windows? How do I do it?


No there isn''t. X doesn''t even know what a button is. It only has concepts of "windows" (in the broad sense: a drawable area that receives and can emit events), events, pixmaps and the such. Xlib is closer to DirectDraw than Win32 in that respect.

You shouldn''t use Xlib to do GUI related stuff: use it if you need a rendering context for OpenGL or if you''re writing a toolkit (or to write your game if you''re masochist). It wasn''t meant to be used for high level applications.

Anyway, you can find a few examples at http://www.linuxgazette.com/issue78/tougher.html.

For more documentation, see http://www.tronche.com (Xlib manual and a few examples).

See how easy it is, and if you think it''s worth it. It''s not too bad but it''s far from the high level MessageBox().

Hope this helps.

Share this post


Link to post
Share on other sites
Well then is there a way to make KDE or Gnome, or another GUI show a message box? Perferably something that''d work on all the GUI''s.

I don''t want to do a ton of work here. It''s just a simple message box saying something like "Hey! somefile.poo is missing!" I may just put a message in the console if its too much work.

Share this post


Link to post
Share on other sites