issue #5685: fix a bug of MenuItemToggle that callback is not correctly initialized when using new