|
Alert box not tied to dialog |
Kevin Epps
Member #5,856
May 2005
|
Can an alert box be called with out it being tied to a dialog(i.e. calling do_dialog) without any problems? I'm trying to create an "are you sure?" quit sequence with my game. I took this example from exgui.c int quit(void) { if (alert("Really Quit?", NULL, NULL, "&Yes", "&No", 'y', 'n') == 1) return 0; else return 1; } And call it like this:
My problem is that sometimes the words comes up and sometimes it doesn't. Also I don't have the mouse showing during the game. But when I call this, the mouse shows on it's own, but it's not the allegro mouse. Should I draw the allegro mouse in the quit function to ensure an accurate click? Because the only way for me get a successful yes, is hitting "Esc" again, which is the default button 1 action. Any help is appreciated? Also, if I messed up with my post in some way. Please don't focus on that as I'm already busy as it is and don't want to see a reply and it's all about the way I posted. Thanks!! |
BAF
Member #2,981
December 2002
|
I'd just do: int quit(void) { int ret; show_mouse(screen); // assumes mouse has been installed ret = !(alert("Really Quit?", NULL, NULL, "&Yes", "&No", 'y', 'n') == 1); show_mouse(NULL); return ret; }
|
Kitty Cat
Member #2,815
October 2002
|
Adding enable_hardware_cursor(); before show_mouse(screen); would be benficial, too. -- |
Andrei Ellman
Member #3,434
April 2003
|
Quote: My problem is that sometimes the words comes up and sometimes it doesn't. Are you using page-flipping or triple-buffering by any chance? This might explain why the words do not always come up. Allegro's GUI only likes to display itself on one of the pages when using page-flipping, and if the page it displays on is not the page being shown, then you wil not see it. AE. -- |
casey d
Member #4,901
August 2004
|
Quote: Are you using page-flipping or triple-buffering by any chance? This might explain why the words do not always come up. Allegro's GUI only likes to display itself on one of the pages when using page-flipping, and if the page it displays on is not the page being shown, then you wil not see it. I get the same problem with page-flipped and triple-buffering, but only in windowed mode. I've never had this problem in fullscreen. -- |
Evert
Member #794
November 2000
|
Have a look at gui_set_screen() if you want to use the GUI along with triple or double buffering. |
|