Code: Select all
#SingleInstance Force
myMenu := MenuBarCreate()
myMenu.Add("Hello", (ItemName, ItemPos, Menu) => MsgBox(ItemPos))
myMenu.Add()
myMenu.Add("World", (ItemName, ItemPos, Menu) => MsgBox(ItemPos))
main := GuiCreate("", "My Gui Title")
main.menuBar := myMenu
; main.MarginX := 0, main.MarginY := 0
main.OnEvent("Close", () => ExitApp())
main.Add("Button", "w200", "Click Me!").OnEvent("Click", "clicked")
main.Show()
clicked(ctrlObj) {
MsgBox(ctrlObj.Gui.Title)
MsgBox(IsObject(ctrlObj.Gui.MenuBar)) ; 0 when I would expect it to show 1
}