Page 1 of 1

CreateMenu

Posted: Thu Jan 04, 2018 8:40 pm
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"}})

Re: CreateMenu

Posted: Thu Jan 04, 2018 11:39 pm
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