Re: [AD] Removing the default close button support |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
> I was thinking that the close hook is not only for the close button,
> e.g. it should be called for Alt-F4 under Windows, so whether the close
> button is clickable is orthogonal to whether the close hook is set.
I agree that the callback should handle all forms of close button. But what
would you let the user click the close button for, if he hasn't registered
any callback ?
My proposition implicitly assumes that the close button will be physically
disabled if no callback was previously registered.
> That's interesting. In that case, maybe the user should be allowed to
> customise the message?
int set_close_button_callback(void (*proc)(void), const char *msg);
On platforms that have a close button, this routine installs a callback
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. If msg is not NULL, a dialog box displaying it will appear so as to
let the user confirm his action; if he doesn't, the callback function will
not be called. You can pass DEFAULT_MSG to display the default
internationalized message.
--
Eric Botcazou