|
Allegro GUI: custom button callback |
ngiacomelli
Member #5,114
October 2004
|
I've spent the past hour searching through (ancient) forum posts regarding the Allegro GUI routines. Before I state my problem, I would like to ask that people please refrain from telling me to try a new GUI system. I'm quite happy with the Allegro solution! Now, as previously stated, I'm trying to write a custom button callback. I have, however, run into some difficulties! Below is the code in question. When the dialog is displayed, the editor_button_proc simply isn't rendered (or registered). I've even tried using the 'f' hotkey (which I assigned it), to no avail. While browsing the code, if you can see that I've made some silly mistake, please don't hesitate to tell me. I've never actually used the Allegro GUI to any great extent before.
|
Tobias Dammers
Member #2,604
August 2002
|
Why do you have to implement this as a callback? Can't you just check which button was used to terminate the dialog, and then do the appropriate thing? --- |
ngiacomelli
Member #5,114
October 2004
|
I wasn't aware that do_dialog returned the exit objects index! D'Oh! I'll give cookies, but I'd still like to know how to achieve the callback, for future reference.
|
Peter Wang
Member #23
April 2000
|
Here's the code from AGUP:
|
ngiacomelli
Member #5,114
October 2004
|
Thank you! I have one last Allegro GUI question... non-blocking menus. I've done some forum searching but have run into a few problems. Here's the necessary code: editor_gui.c
Now, I've tried calling update_menu with both my logic and rendering code, but nothing seems to work. Is update_menu actually rendering anything, or just updating the menus logic/state? The manual is slightly unclear on this. I've set the render bitmap to my buffer, but how can I specify when it's rendered?
|
|