Re: [AD] excustom

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


On Sat, 2005-08-27 at 20:26 +1000, Peter Wang wrote:
> > Yes, that's all it wants to show.. you can continuously update something
> > (normally it would be e.g. dumb_poll, and not drawing a clock), while
> > displaying a menu. The Allegro GUI of course can't overlap with any
> > other graphics.
> 
> I think the example would be misleading so better not to commit your patch.
> 

Well, you can't overlap any GUI elements, the menu is no exception. Now,
since menus overlap by their nature, the Allegro GUI simply shuts down
completely (it even stops sending MSG_IDLE) while the mouse is over any
menu.

This causes a problem though - MSG_IDLE doesn't do what it says if a
d_menu_proc is in the same dialog. E.g. even d_yield_proc or so stop
working.

In the end, we have two possibilities.

- Apply the attached patch, and state that you shouldn't use
d_yield_proc or MSG_IDLE at all, if using menus, if you want them to do
what they say they do in the docs.

- Or, apply my patch (maybe should add more explanation to it), showing
the only clean way to keep MSG_IDLE doing what it says in the docs (at
least, the only I found). I.e. manually send MSG_IDLE for all dialogs
where you know it is save, two examples are given: d_yield_proc, and a
clock which is known to never overlap.

I don't see what is misleading there.. but I can add more documentation
of course.

-- 
Elias Pschernig
Index: examples/excustom.c
===================================================================
RCS file: /cvsroot/alleg/allegro/examples/excustom.c,v
retrieving revision 1.13
diff -r1.13 excustom.c
203a204
>    DIALOG_PLAYER *dialog_player;
239,240c240,245
<    do_dialog(the_dialog, -1);
<    
---
>    show_mouse(screen);
>    dialog_player = init_dialog(the_dialog, -1);
>    while (update_dialog(dialog_player)) {
>        rest(1);
>    }
>    shutdown_dialog(dialog_player);


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