Closed hkdb closed 4 years ago
Normally, the default menu is removed. What do you mean by menu area
?
Here's my code for the bootstrap part:
// Run bootstrap
l.Printf("Running app built at %s\n", BuiltAt)
if err := bootstrap.Run(bootstrap.Options{
Asset: Asset,
AssetDir: AssetDir,
AstilectronOptions: astilectron.Options{
AppName: "Super App",
AppIconDarwinPath: "resources/icon.icns",
AppIconDefaultPath: "resources/logo.png",
SingleInstance: true,
},
Debug: true, //*debug,
Logger: l,
RestoreAssets: RestoreAssets,
Windows: []*bootstrap.Window{{
Homepage: "index.html",
MessageHandler: handleMessages,
Options: &astilectron.WindowOptions{
BackgroundColor: astikit.StrPtr("#333"),
Center: astikit.BoolPtr(true),
Height: astikit.IntPtr(windowHeight),
Width: astikit.IntPtr(windowWidth),
},
}},
}); err != nil {
l.Fatal(fmt.Errorf("running bootstrap failed: %w", err))
}
I didn't specify a menu at all and I am getting the blank menu area marked in red as per the screenshot above the code snippet.
Thanks!
Are you testing on MacOSX ? If so, which version are you using ?
I am on Pop! OS 20.04 but the final product is targeted to run on Windows, MacOS, and Linux. Thanks!
Setting Debug
to true
creates a menu. Could you try with Debug
set to false
?
Ahhhh I see! menu area is gone as soon as I set the debug to false. Thank you!
Cheers
Sorry to keep pestering you about this and I really appreciate your help but I just noticed that while in Linux, I am able to paste just fine, in MacOS, it doesn't work. So I found this:
https://github.com/asticode/go-astilectron/issues/68
But doesn't that mean that I have to build a menu item and have a menu just so I can have copy and paste?
Thanks!
Unfortunately yes, you need to set menu items with proper shortcuts in order to copy/paste
Looks like as long as I set an empty label on the menu item, the menu area doesn't show up in mac. So I guess my solution for now is to have the build script comment out that menuOptions block for the Linux build and un-comment the block for the Mac build. A dirty hack but will certainly accomplish what I need. Off to Windows testing!
Thanks again for your help!
Is there a proper go-astilectron bootstrap options way to remove the menu area all together? I don't plan on having any menus at all in my app.
Thanks!