Allegro.cc - Online Community

Allegro.cc Forums » Allegro Development » `al_show_native_message_box` buttons argument ignored

This thread is locked; no one can reply to it. rss feed Print
 1   2 
`al_show_native_message_box` buttons argument ignored
Luiji99
Member #12,254
September 2010

From what I can tell, if there's only three buttons you can just change their labels...

Programming should be fun. That's why I hate Java.

Karadoc ~~
Member #2,749
September 2002
avatar

Luiji99 said:

From what I can tell, if there's only three buttons you can just change their labels...

I have no idea what you are trying to communicate by this statement.

Only three buttons where? Change what labels, and how, and for what goal?

-----------

Luiji99
Member #12,254
September 2010

If you had three or less buttons, if the information I've gathered is correct, you can use the built-in message box and just change the button labels. I'm not exactly sure how, but it seems there's something more than MessageBox.

Programming should be fun. That's why I hate Java.

Karadoc ~~
Member #2,749
September 2002
avatar

I see. Well, that would be good, but I don't think there is any way to change the button names (or anything else) on any of the standard dialogs. And even if that can be done, we'd still be lacking an implementation for > 3 buttons. Anyway, let us know if you work something out.

-----------

Luiji99
Member #12,254
September 2010

I found some information. It's not exactly what I recalled, but it looks simpler than what you've been doing so far. It essentially has you intercept the messages that normally go to a message box and just customize it. http://www.catch22.net/tuts/custom-messagebox

Programming should be fun. That's why I hate Java.

Karadoc ~~
Member #2,749
September 2002
avatar

By the sounds of that, it is possible to intercept a standard message box during the creation process, and then use whatever API functions are available to edit pre-existing windows. Maybe that would be easier, but it sounds a bit sketchy to me. I'm sure that's not how the API is meant to be used...

In any case, even with that idea, I still don't know how to rename buttons and stuff - I'd have to learn about some new API functions and so on I suppose. Also, as far as I can tell, the customization of the window has to be done inside the callback function - and so we need to somehow get our data into that callback function. The only ways that come to mind are boost::bind (ie. bind our data with a generalized function to create a unique callback function every time we want to make a custom message box), or global variables (store the data somewhere global so that the callback function can use it). -- Neither of those options sound very attractive to me.

So.. if/when I try to beautify the stuff I've already done, I think I'll just build on the current implementation rather than trying to use these hook/callback tricks. -- But I wouldn't discourage someone else from trying that other stuff if they thought it would turn out better.

-----------

 1   2 


Go to: