diff --git a/v2/internal/binding/binding.go b/v2/internal/binding/binding.go index 479f964b3..ca063c5ca 100755 --- a/v2/internal/binding/binding.go +++ b/v2/internal/binding/binding.go @@ -25,7 +25,7 @@ func (b *Bindings) Add(structPtr interface{}) error { methods, err := getMethods(structPtr) if err != nil { - return fmt.Errorf("cannout bind value to app: %s", err.Error()) + return fmt.Errorf("cannot bind value to app: %s", err.Error()) } for _, method := range methods { diff --git a/v2/pkg/logger/default.go b/v2/pkg/logger/default.go index 036316c64..a7c43d82a 100644 --- a/v2/pkg/logger/default.go +++ b/v2/pkg/logger/default.go @@ -4,7 +4,7 @@ import ( "os" ) -// DefaultLogger is a utlility to log messages to a number of destinations +// DefaultLogger is a utility to log messages to a number of destinations type DefaultLogger struct{} // NewDefaultLogger creates a new Logger. diff --git a/v2/pkg/menu/menuitem.go b/v2/pkg/menu/menuitem.go index b107c4c0c..d3b14fc91 100644 --- a/v2/pkg/menu/menuitem.go +++ b/v2/pkg/menu/menuitem.go @@ -23,6 +23,12 @@ type MenuItem struct { // Submenu contains a list of menu items that will be shown as a submenu SubMenu []*MenuItem `json:"SubMenu,omitempty"` + // Foreground colour in hex RGBA format EG: 0xFF0000FF = #FF0000FF = red + Foreground int + + // Background colour + Background int + // This holds the menu item's parent. parent *MenuItem } diff --git a/v2/pkg/options/default.go b/v2/pkg/options/default.go index 915007cdc..463416854 100644 --- a/v2/pkg/options/default.go +++ b/v2/pkg/options/default.go @@ -17,7 +17,6 @@ var Default = &App{ Appearance: mac.DefaultAppearance, WebviewIsTransparent: false, WindowBackgroundIsTranslucent: false, - //Menu: menu.DefaultMacMenu(), }, Logger: logger.NewDefaultLogger(), LogLevel: logger.INFO, diff --git a/v2/pkg/options/options.go b/v2/pkg/options/options.go index 7d24e72e3..f1fba76cb 100644 --- a/v2/pkg/options/options.go +++ b/v2/pkg/options/options.go @@ -39,14 +39,6 @@ func MergeDefaults(appoptions *App) { log.Fatal(err) } - // We need to ensure there's a default menu on Mac - switch runtime.GOOS { - case "darwin": - if GetApplicationMenu(appoptions) == nil { - appoptions.Menu = menu.NewMenuFromItems(menu.AppMenu()) - } - } - } func GetTray(appoptions *App) *menu.TrayOptions { diff --git a/v2/test/runtime/main.go b/v2/test/runtime/main.go index c2f114831..511ac2886 100644 --- a/v2/test/runtime/main.go +++ b/v2/test/runtime/main.go @@ -4,6 +4,7 @@ import ( "github.com/wailsapp/wails/v2" "github.com/wailsapp/wails/v2/pkg/options" "github.com/wailsapp/wails/v2/pkg/options/mac" + "log" ) type Echo struct { @@ -16,7 +17,7 @@ func (e *Echo) Echo(message string) string { func main() { // Create application with options - app := wails.CreateAppWithOptions(&options.App{ + app, err := wails.CreateAppWithOptions(&options.App{ Title: "Runtime Tester!", Width: 850, Height: 620, @@ -33,6 +34,10 @@ func main() { }, }) + if err != nil { + log.Fatal(err) + } + // You can also use the simplified call: // app := wails.CreateApp("Tester!", 1024, 768) @@ -50,5 +55,8 @@ func main() { app.Bind(&Echo{}) app.Bind(&RuntimeTest{}) - app.Run() + err = app.Run() + if err != nil { + log.Fatal(err) + } }