Re: [AD] Removing the default close button support |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On 2002-11-01, Eric <ebotcazou@xxxxxxxxxx> wrote:
> > 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 ?
I don't know :-)
> My proposition implicitly assumes that the close button will be physically
> disabled if no callback was previously registered.
Ok.
> > 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.
Ok, but how would the internationalised message thing work? I hope it
is not an implicit get_config_text() call in set_close_button_callback().
--
王浩禎