home *** CD-ROM | disk | FTP | other *** search
- /* GadTools layout toolkit
- **
- ** Copyright © 1993-1995 by Olaf `Olsen' Barthel
- ** Freely distributable.
- **
- ** :ts=4
- */
-
- #include "gtlayout_global.h"
-
- #ifdef DO_MENUS
-
- /* LT_GetMenuItem(struct Menu *Menu,ULONG ID):
- *
- * Obtain the menu item associated with the ID.
- */
-
- struct MenuItem * LIBENT
- LT_GetMenuItem(REG(a0) struct Menu *Menu,REG(d0) ULONG ID)
- {
- RootMenu *Root = (RootMenu *)((ULONG)Menu - offsetof(RootMenu,Menu));
- ItemNode *Item;
-
- // Run down the list...
-
- for(Item = (ItemNode *)Root -> ItemList . mlh_Head ; Item -> Node . mln_Succ ; Item = (ItemNode *)Item -> Node . mln_Succ)
- {
- if(Item -> ID == ID)
- return(&Item -> Item);
- }
-
- // Nothing found
-
- return(NULL);
- }
-
- #endif /* DO_MENUS */
-