Re: [AD] new window hooks patch |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
Angelo Mottola <a.mottola@xxxxxxxxxx> wrote:
> This new one adds routines to set up to 8 callbacks for window
> closing/resizing events; the gfx driver developer only has to call
> _handle_window_close() or _handle_window_resize(w, h) when needed.
How did you come to the conclusion of 8 callbacks? Personally, I
would be satisfied with one (i.e. a function pointer), as this one
function can go off and call as many other functions as it likes
(using a registration system like your patch if necessary). If you
were thinking about many addon packages all needing callbacks, then
an unlimited linked list would be better. But I really can't think
of a situation you need more than one callback.
> The _handle_window_close() function other than calling queued callbacks, also
> simulates an ESC keypress, as suggested by Robert J. Ohannessian, as this
> works great and doesn't break compatibility with the past.
I'd prefer if it didn't do that. The user can easily do this in one
of the hook functions. Also, you can't prove that the user program
doesn't interpret Escape as a "Delete all files!" command :-)
--
CIRCULOIN TECHNIQUE (SUR kew loyn tek NEEK), n. The popular approach
to steak dining in which one eats around the edges first, then works
his way toward the middle. -- Rich Hall, "Sniglets"