From: Angelo M. <a.m...@li...> - 2001-01-12 22:03:01
|
> How did you come to the conclusion of 8 callbacks? I thought of a system similar to the current display switching routine... More than one callback could have been nice, giving more flexibility. Anyway, it seems my try wasn't well accepted, so I've modified it a lot. This time I've based my work on Bob's resize hook one; one callback for the close event is now allowed. The patch I'm attaching here replaces Bob's one; hope you don't mind, as the only modification to your code was to rename set_resize_hook and get_resize_hook to more comprehensible set_window_resize_hook (get_window_resize_hook). I've also removed the X11 resize code you added, as it wasn't compiling and it also made no sense there... Michael, correct me if I'm wrong, but the function where the resize code was into is meant to resize the system program window only when the user sets a new windowed gfx mode. About window resizeing, shouldn't the gfx driver also reset the screen buffer line pointers? I think the resize system is still a premature feature in Allegro... Back to my patch. Now when the user hits the close window button, an ESC keypress is simulated and the hook function is called (if set). The patch adds window close support to X, BeOS and Win32 (but this last one can be wrong, as I've not tested it. To avoid confusion, I've commented out the old code in wwnd.c, so we can restore it if needed; please check it out). allegro._tx has also been updated with the new functions doc. > 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 :-) Humm, this works nicely with all the Allegro distro programs and examples AFAICS, except exkeys. In addition, it is explained in the docs, so the coder knows of this behaviour. If you prefer, we could make CTRL-ALT-END keypresses simulated instead of the ESC key, but this sounds horrible to me... -- Angelo Mottola a.m...@li... ICQ UIN #66972680 |