diff --git a/main.go b/main.go index d352302..10c6680 100644 --- a/main.go +++ b/main.go @@ -32,7 +32,7 @@ type MyMainWindow struct { const ( AppName string = "BeadImager" - Version string = "0.4.0" + Version string = "0.4.1" CopyRight string = "©2022 Jan Lerking" STD_MESS string = "Ready" LogFile string = "BeadImager.log" @@ -55,6 +55,7 @@ func SetupMainWindow(mw *MyMainWindow) { mw.MainWindow, _ = walk.NewMainWindow() mw.MainWindow.SetTitle(AppName + " " + Version) mw.MainWindow.SetMinMaxSize(walk.Size{Width: 800, Height: 600}, walk.Size{Width: math.MaxInt32, Height: math.MaxInt32}) + SetupMenu(mw) //mw.MainWindow.SetSize(walk.Size{Width: 800, Height: 600}) vb := walk.NewVBoxLayout() mw.MainWindow.SetLayout(vb) diff --git a/menu.go b/menu.go new file mode 100644 index 0000000..5b36a0c --- /dev/null +++ b/menu.go @@ -0,0 +1,26 @@ +package main + +import "github.com/lxn/walk" + +func SetupMenu(mw *MyMainWindow) { + // MenuBar + var tool *walk.Action + var menutool *walk.Menu + menutool, _ = walk.NewMenu() + tool = walk.NewMenuAction(menutool) + tool.SetText("File") + open := walk.NewAction() + open.SetText("Open") + exit := walk.NewAction() + exit.SetText("Exit") + + menutool.Actions().Add(open) + menutool.Actions().Add(exit) + + men2, _ := walk.NewMenu() + too2 := walk.NewMenuAction(men2) + too2.SetText("Help") + + mw.MainWindow.Menu().Actions().Add(tool) + mw.MainWindow.Menu().Actions().Add(too2) +}