| 834 | } |
| 835 | |
| 836 | void |
| 837 | InitMenuRes() |
| 838 | { |
| 839 | static Boolean was_inited = 0; |
| 840 | short i, j; |
| 841 | menuListHandle mlHnd; |
| 842 | MenuHandle menu; |
| 843 | |
| 844 | if (was_inited) |
| 845 | return; |
| 846 | was_inited = 1; |
| 847 | |
| 848 | mustGetMenuAlerts(); |
| 849 | |
| 850 | for (i = listMenubar; i <= listSubmenu; i++) { |
| 851 | if (!(mlHnd = |
| 852 | (menuListHandle) GetResource('MNU#', (menuBarListID + i)))) |
| 853 | menuError(errGetMenuList); |
| 854 | |
| 855 | pMenuList[i] = (menuListPtr) NewPtr(GetHandleSize((Handle) mlHnd)); |
| 856 | *pMenuList[i] = **mlHnd; |
| 857 | |
| 858 | for (j = 0; j < pMenuList[i]->numMenus; j++) { |
| 859 | if (!(menu = (MenuHandle) GetMenu((**mlHnd).mref[j].mresID))) { |
| 860 | Str31 d; |
| 861 | NumToString((**mlHnd).mref[j].mresID, d); |
| 862 | menuError(errGetMenu); |
| 863 | } |
| 864 | |
| 865 | pMenuList[i]->mref[j].mhnd = menu; |
| 866 | SetMenuID(menu, j + (**mlHnd).firstMenuID); /* consecutive IDs */ |
| 867 | |
| 868 | /* expand apple menu */ |
| 869 | if ((i == listMenubar) && (j == menuApple)) { |
| 870 | AppendResMenu(menu, 'DRVR'); |
| 871 | } |
| 872 | |
| 873 | InsertMenu(menu, ((i == listSubmenu) ? hierMenu : 0)); |
| 874 | } |
| 875 | } |
| 876 | DrawMenuBar(); |
| 877 | return; |
| 878 | } |
| 879 | |
| 880 | void |
| 881 | AdjustMenus(short dimMenubar) |
no test coverage detected