You’re actually supposed to use the “Custom Menu” widget and place it inside of the “Header Right” widget area. That’s the way you’d want to do it, as it wouldn’t require any custom coding. Just drag and drop on your widgets page, then select the menu that you want to use (Primary). That’s also how the demo is setup.