CreateMenu

Discuss any general programming issues here
Post Reply
sashapont
Posts: 152
Joined: Thu Aug 03, 2017 2:49 pm

CreateMenu

Post by sashapont »

Are there any working CreateMenu sample?

I try use it like this and have errors

Code: Select all

aa= CreateMenu("File", {
        {"New", ID = "new"},  
        {"Save", ID = "save"}, 
        {"Print", ID = "print"}, 
        {""},
        {"Quit", ID = "quit", Hotkey = "Q"}})
Tipsi
Posts: 21
Joined: Sun Feb 14, 2010 6:06 pm
Location: Switzerland

Re: CreateMenu

Post by Tipsi »

Hi sashapont

You forgot the "id" and you're missing a "{ }":

Code: Select all

CreateMenu(1, {
              {"File", {
                       {"New", ID = "new"}, 
                       {"Save", ID = "save"},
                       {"Print", ID = "print"},
                       {""},
                       {"Quit", ID = "quit", Hotkey = "Q"}
                       }
              }
              })
or

Code: Select all

aa = CreateMenu(Nil, {
                     {"File", {
                              {"New", ID = "new"}, 
                              {"Save", ID = "save"},
                              {"Print", ID = "print"},
                              {""},
                              {"Quit", ID = "quit", Hotkey = "Q"}
                              }
                     }
                     })
Griessli
Tipsi
Post Reply