[AD] [DOCS] set_window_close_hook

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


Who is responsible for writing what is hopefully the only self-contradictory
item in the docs ?


"void set_window_close_hook(void (*proc)());
On platforms that have a close button, this routine installs a hook function
to handle the close event. In other words, when the user clicks the close
button on your program's window, the function you specify here will be
called.

You can use this function to display a box offering to save data or checking
that the user really wants to exit, or you can use it just to *save config
data*, free memory and *exit*.

This function should not generally attempt to *exit* the program or *save
any data* itself. The function could be called at any time, and there is
usually a risk of trying to save when the data are invalid. Instead, you
should set a flag during this function, and test the flag on a regular basis
in the main program."

[*emphasis* by me]


I propose to simply get rid of §2 for the 4.0.2 release.

--
Eric Botcazou
ebotcazou@xxxxxxxxxx



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