0.4.1 Menu added. /JL
This commit is contained in:
3
main.go
3
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)
|
||||
|
26
menu.go
Normal file
26
menu.go
Normal file
@@ -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)
|
||||
}
|
Reference in New Issue
Block a user