Re: [AD] d_menu_proc MSG_DRAW handling

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


> >  That's right. d_menu_proc knows only of the underlying static dialog
> > object.
> Why not have it walk the active_menu_player tree and redraw them?

Because the sub-menus may overlap other dialog objects and the dialog engine 
can only handle non-overlapping objects for the time being.

> Understood.  However, with the non-blocking menu setup, the main loop
> which is calling update_dialog(), on a DIALOG array containing a
> d_menu_proc object, may alter the screen and wish for the (perhaps active)
> menu (particularly in such cases where it is the only portion of the GUI
> that is present) to be redrawn (dialog_message(MSG_DRAW)).

Sure.

> D'oh.  I hadn't noticed that, though I was going to check before I
> submitted a patch.  The changes potentially break my planned code
> completely, arg.

"arg" is indeed the correct wording in such a situation :-)

> My solution had been to have d_menu_proc(MSG_DRAW) walk through the
> active_menu_player tree and draw each child menu in order and update the
> player->saved bitmap for each;

Looks good.

> since d_menu_proc(MSG_DRAW) is not typically called with an active menu, it 
> should only affect apps that meant for the child menus to be redrawn. That
> would still work, but it would now be unable to tell any other dialog
> objects present to redraw themselves.  Back to the drawing board...

Because of the big comment in dialog_message()? Hmm... yes, certainly. But 
you can maybe try make an exception for MSG_DRAW.

-- 
Eric Botcazou




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