[comp.sys.next] Submenus and menu updates

combs@sumex-aim.stanford.edu (Dave Combs) (01/19/90)

Gang,
There appears, given the current documentation, to be no way to access
the submenu to be called from a given menu item.  It's easy to find out
that the item HAS a submenu, but appears impossible to find out what
object that submenu actually IS.
Is this correct?  If I want to change a submenu dynamically at runtime,
it appears to be quite a pain to do so (basically, I have to add a submenu
of my own, and keep track of that submenu myself).

Question 2 - It also appears that there is no way to easily REMOVE an item
from a menu once it has been allocated (other than getting the itemlist,
figuring out the row in which the item exists, using the Matrix commands,
removing a row of the itemList matrix, and asking the menu to resize itself).
You'd think that an "addItem" command would have a corresponding "removeItem"
command, wouldn't you?
Again, is this correct?  If not, any pointers would be appreciated.

Thanks,
Dave  (combs@sumex-aim.stanford.edu)

eps@toaster.SFSU.EDU (Eric P. Scott) (01/19/90)

In article <1189@shelby.Stanford.EDU>
	combs@sumex-aim.stanford.edu (Dave Combs) writes:
>There appears, given the current documentation, to be no way to access
>the submenu to be called from a given menu item.  It's easy to find out
>that the item HAS a submenu, but appears impossible to find out what
>object that submenu actually IS.

If [aMenuCell hasSubmenu] is true, [aMenuCell target] is the id
of the submenu.

>Question 2 - It also appears that there is no way to easily REMOVE an item
>from a menu once it has been allocated (other than getting the itemlist,
 ...
>Again, is this correct?

You don't need to walk the itemlist if you have the MenuCell id.
Use getRow:andCol:ofCell: (Matrix) followed by
removeRowAt:andFree: (Matrix).  I haven't actually tried this,
but you may have to sizeToFit the matrix before sizeToFit on the
menu.

					-=EPS=-