Recently, I changed the API of vgui_menu::add to take a vgui_command_sptr
instead of a vgui_command* to make clear the expectations for the
parameters. I'd thought this would be a transparent change, since
existing vgui_command* should be converted to
vgui_command_sptr's. However, there is an overload for a toggle
button that takes a bool parameter, which is a better conversion
(since it involves no user defined conversions). This overload has
also been problematic in the past with callback functions.
As far as I can tell, it is only used in a few places. Further, I
think it is an unnecessary and confusing API. I suggest that it is
removed. Then, the obsoleted call to
menu.add( "name", bool_initial_value );
can be achieved by the more explicit
menu.add( "name", new vgui_command_toggle(bool_initial_value) );
Does anyone have an objection to this?