[comp.windows.open-look] How do you get the number of a menu item.

csb@gdwb.oz.au (Craig Bishop) (03/12/91)

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.
-- 
Craig Bishop			Geelong & District Water Board
Phone: +61 52 262506		61-67 Ryrie St Geelong
Fax:   +61 52 218236		Victoria 3220 Australia

helvie@EBay.Sun.COM (Fred Helvie) (03/13/91)

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