On Sat, Feb 07, 2009 at 08:20:18PM +0000, corvid wrote:
Jeremy wrote:
There is IMHO a nasty code smell around a_Html_add_new_image(): it takes a boolean parameter that determines whether or not it actually adds the image. It's only called from two other places, once with the parameter set to false and once with it set to true. [...] In principle it might be dangerous in some way for the callers to wait to add widgets until after Html_load_image() is called,
If we want the a_Html_* API to guard against that then that is another reason for changing it, since the current API allows you to create the image and not add it. In that case I'd suggest applying my patch and then changing a_Html_image_new() to static Html_image_new() and adding a_Html_add_new_image() and a_Html_add_new_image_button(). That would fix the code smell *and* enforce the "add any image that you create" condition. Does that make sense? Regards, Jeremy Henty