This file is indexed.

/usr/share/SuperCollider/HelpSource/Classes/CocoaMenuItem.schelp is in supercollider-common 1:3.6.3~repack-5.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
class:: CocoaMenuItem
summary:: Abstract superclass of OSX Menu Items
categories:: GUI>Kits>Cocoa
related:: Classes/SCMenuItem, Classes/SCMenuGroup, Classes/SCMenuSeparator

description::
CocoaMenuItem represents a menu item or sub menu in the application menu. This is an abstract class. Generally you will deal with the subclasses SCMenuItem, SCMenuGroup, and SCMenuSeparator, but the convenience method *add (see below) allows one to easily add items to a default 'Library' menu.


classmethods::

method:: clearCustomItems
Clear all custom menu items.

method:: default
Returns the 'Library' menu, creating it if necessary.

method:: add
Add an item to the Library menu. The Library menu will be created automatically if needed.
argument:: names
An link::Classes/Array:: of link::Classes/String::s indicating the menu path to this item.
argument:: action
A link::Classes/Function:: that will be evaluated when this item is selected.


instancemethods::

method:: action
Get or set this item's action. This is a Function that will be evaluated when this item is selected.


method:: state
Get or set this item's state.
argument:: bool
If bool is true a check mark is displayed next to the item.

method:: remove
Remove the receiver and its children (if any).

method:: enabled
Enable or disable this menu item.
argument:: bool
A link::Classes/Boolean:: indicating whether this item should be enabled or disabled.

method:: setShortCut
Set the keyboard shortcut for this item. The Cmd key is assumed.
argument:: string
A link::Classes/String:: indicating the character for this shortcut.
argument:: alt
A link::Classes/Boolean:: indicating whether the alt key is included in this shortcut. Default value is false.
argument:: ctrl
A link::Classes/Boolean:: indicating whether the ctrl key is included in this shortcut. Default value is false.

method:: doAction
Evaluate the receiver's action function.


examples::

code::
// Simple example
g = SCMenuGroup(nil, "stuff", 10);
i = SCMenuItem(g, "foo");
j = SCMenuItem(g, "bar");
j.action = { "bar!!".postln };
k = SCMenuSeparator(g, 1); // add a separator
i.enabled = false;
j.state = true;
j.setShortCut("$", true, true); // Cmd-ctrl-alt-$

// using *add
CocoaMenuItem.add(["hallo", "world"], { "hallo menu".postln });
CocoaMenuItem.add(["hallo", "world", "here"], { "hallo here".postln }); // fails correctly
CocoaMenuItem.add(["mellow", "world", "here"], { "mellow here".postln }); // works.
CocoaMenuItem.add(["hallo", "thought"], { "hallo world".scramble.postln });

CocoaMenuItem.clearCustomItems;
::