Re: [AD] set_window_close_button_callback_hook_button()

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


> > Only applies to stable branches. We can't guarantee API compatibility
> > during development.
>
> Then that should be noted in api.txt ;)

Will do.

> So, whenever the warning message / forced close was would have appeared,
> the button gets disabled instead. I fail to see how this change would break
> any programs (in particular, if they were relying on the warning message,
> then they were broken already).

Huh !? Is that not a runtime breakage of the API ? With the same code, you 
would have got a close button that kills your program in the first case, and 
no close button at all in the second case.

> > These functions are not orthogonal. Only one function for one
> > functionality.
>
> Which is why we have draw_sprite() and masked_blit().

Unfair comparison IMHO because you don't need to call *both* functions in 
order to achieve your goal. With your interdependent functions, we would end 
up with 4 combinations:

set_window_close_button(FALSE);
set_window_close_hook(NULL);             button greyed out

set_window_close_button(TRUE);
set_window_close_hook(NULL);             button greyed out

set_window_close_button(FALSE);
set_window_close_hook(my_callback);             button greyed out

set_window_close_button(TRUE);
set_window_close_hook(my_callback);             button activated

The table clearly shows that the two functions can be factored into only one 
function, namely set_close_button_callback().

> I don't see why having two functions is a problem. The system would work,
> and we wouldn't have broken backwards compatibility.

I do maintain that we would have broken backwards compatibility at runtime, 
which is worse than at compile time from my point of view.

> That's only a rule of thumb, and it doesn't apply here. I challenge you to
> think of a single scenario where a program would be broken by such a
> change.

I guess that we don't exactly agree on what "broken" means in that context. 

For example, doing

	set_window_close_button(TRUE);

would cause the window to have a close button that kills it in the first case, 
and no close button in the second case. Haven't we broken a program that 
needs to have a close button for some reasons ?

> I know who to flame in DUMB v0.9.1's docs then ;)

Great! The more times I see my name somewhere, the happier I am ;-)

-- 
Eric Botcazou



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