Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!sun-barr!newstop!male!silverwood!helvie From: helvie@EBay.Sun.COM (Fred Helvie) Newsgroups: comp.windows.open-look Subject: Re: How do you get the number of a menu item. Message-ID: Date: 12 Mar 91 21:53:28 GMT References: <580@rome.gdwb.oz.au> Sender: news@male.EBay.Sun.COM Lines: 34 csb@gdwb.oz.au (Craig Bishop) writes: >In a application I am working on I need to reset the default >menu item before the menu is displayed. To do that I use a > xv_set(Menu, MENU_DEFAULT, Number, NULL); >The only problem is that I cannot find a simple way to find >out the number of the menu item I wish to set as the default. If you have the handle to the menu item itself, try this: xv_set(Menu, MENU_DEFAULT_ITEM, item, NULL); To get the handle of a specific item try: item = xv_find(Menu, MENUITEM, MENU_STRING, "default choice", NULL); Menu items are not really "numbered" until they are placed into the menu; then the numbering begins with 1. If you have a title item, this will be the first item. >-- >Craig Bishop Geelong & District Water Board >Phone: +61 52 262506 61-67 Ryrie St Geelong >Fax: +61 52 218236 Victoria 3220 Australia Hope this helps. Fred Helvie Sun Education - Milpitas, CA - USA