MenuHasParentException

From Real Software Documentation

Jump to: navigation, search
Class (inherits from RuntimeException)

Occurs when code tries to use the same MenuItem in different places. This is a limitation of the Cocoa framework.


NOTE: Starting with the upcoming Real Studio 2011r4, the same behavior will apply to all platforms. If you currently use the same MenuItem in more than one location, you should use the new MenuItem.Clone method create independent duplicates of the original MenuItem and switch to the new design. See this article on the Real Software blog for more information.


Examples

Whenever you need to use the same MenuItem in different places, use the Clone method to create a new copy of the MenuItem and its children, if any.

dim mi as new MenuItem( "My menu item" )
dim myClone as MenuItem

myClone = mi.Clone //Creates an independent copy of "mi"

See Also

Personal tools