Re: Windows Menu Items Not 'Clickable'
- Posted by evanmars Jan 23, 2014
- 1661 views
Here is a bit more complete bit of code:
In WinProc:
case WM_CREATE then MakeMenu(hwnd) return 0
MakeMenu function:
function MakeMenu( atom hwnd ) menubar = c_func(CreateMenu,{}) submenu = c_func(CreatePopupMenu,{}) --FILE menu c_func(AppendMenuA,{submenu, MF_STRING, ID_NEW, Menu_NEW}) c_func(AppendMenuA,{submenu, MF_STRING, ID_OPEN, Menu_OPEN}) c_func(AppendMenuA,{submenu, MF_STRING, ID_SAVE, Menu_SAVE}) c_func(AppendMenuA,{submenu, MF_STRING, ID_SAVEAS, Menu_SAVEAS}) c_func(AppendMenuA,{submenu, MF_STRING, ID_EXIT, Menu_EXIT}) c_func(AppendMenuA,{menubar, MF_STRING + MF_POPUP, submenu, Menu_FILE}) submenu = c_func(CreatePopupMenu,{}) --EDIT menu c_func(AppendMenuA,{menubar, MF_STRING + MF_POPUP, submenu, Menu_EDIT}) submenu = c_func(CreatePopupMenu,{}) --VIEW menu c_func(AppendMenuA,{menubar, MF_STRING + MF_POPUP, submenu, Menu_VIEW}) submenu = c_func(CreatePopupMenu,{}) --TOOLS menu c_func(AppendMenuA,{submenu, MF_STRING, ID_SETTINGS, Menu_SETTINGS}) c_func(AppendMenuA,{menubar, MF_STRING + MF_POPUP, submenu, Menu_TOOLS}) submenu = c_func(CreatePopupMenu,{}) --HELP menu c_func(AppendMenuA,{menubar, MF_STRING + MF_POPUP, submenu, Menu_HELP}) c_func(SetMenu, {hwnd,menubar}) return 0 end function