Re: [AD] Removing the default close button support

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


> > so we don't need two functions anymore in order to handle it.
>
> Not so sure about this.

Why ? Can't we simply merge the two former functions ? 
set_close_button_callback() will enable the close button if it is passed a 
non-NULL argument and disable it if it is passed a NULL argument.

This new behaviour overlaps that of set_window_close_button(), so I don't see 
why we should keep it. On the other hand, for backward compatibility, the 
deprecated set_window_close_button() could still work like in the 4.0.x 
series.

> Well, it's not the first time "hook" has been used instead of "callback"
> so I think it should just be left as is.  (And IMHO Allegro usually
> means "hook" where it has "callback".)

I don't think we should keep the same name if we changed the behaviour of the 
function, as I'm proposing. Moreover, to ease the transition between 4.0.x and 
4.1.x, we could still provide the dialog box with the famous message (yes, 
Grzegorz, in that case I wouldn't forget your patch :-) as an option:

int set_close_button_callback(void (*proc)(void), int enable_confirmation);
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 enable_confirmation is set to TRUE, a dialog box will appear so as 
to let the user confirm his action; if he doesn't, the callback function   
will not be called.

-- 
Eric Botcazou



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