public static void SetMenuTitle(IntPtr menuRef, string title) { IntPtr str = CoreFoundation.CreateString(title); CarbonMenuStatus result = SetMenuTitleWithCFString(menuRef, str); CoreFoundation.Release(str); CheckResult(result); }
public static void SetMenuItemText(IntPtr menuRef, ushort index, string title) { IntPtr str = CoreFoundation.CreateString(title); CarbonMenuStatus result = SetMenuItemTextWithCFString(menuRef, index, str); CoreFoundation.Release(str); CheckResult(result); }
public static ushort InsertMenuItem(IntPtr parentRef, string title, ushort afterItemIndex, MenuItemAttributes attributes, uint commandId) { IntPtr str = CoreFoundation.CreateString(title); CarbonMenuStatus result = InsertMenuItemTextWithCFString(parentRef, str, afterItemIndex, attributes, commandId); CoreFoundation.Release(str); CheckResult(result); return((ushort)(afterItemIndex + 1)); }
public static ushort AppendMenuItem(IntPtr parentRef, string title, MenuItemAttributes attributes, uint commandId) { ushort index; IntPtr str = CoreFoundation.CreateString(title); CarbonMenuStatus result = AppendMenuItemTextWithCFString(parentRef, str, attributes, commandId, out index); CoreFoundation.Release(str); CheckResult(result); return(index); }