Ghpython Grasshopper add top menu bar

Hi,All ! In Grasshopper, I want to add a menu bar at the top of the interface using GhPython code. I found that using Grasshopper.Instances.DocumentEditor.MainMenuStrip.Items.Add('Test') can create a ‘Test’ menu bar. However, after compiling and packaging my GhPython code, when I reopen Grasshopper, it indicates that Grasshopper.Instances.DocumentEditor is None and does not have the MainMenuStrip method. How can I add a menu bar successfully at the top after my code is compiled and Grasshopper has finished loading?
image