File: TreeViewItem.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (136 lines) | stat: -rw-r--r-- 3,388 bytes parent folder | download | duplicates (3)
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
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
CLASS:: TreeViewItem
summary:: An item in TreeView
categories:: GUI>Views

DESCRIPTION::

An instance of TreeViewItem represents an item in TreeView. There may be multiple instances representing the same item, e.g. after calling link::Classes/TreeView#-currentItem:: multiple times.

INSTANCEMETHODS::

PRIVATE:: prValidItem

METHOD:: index
	RETURNS:: An integer position of this item among its siblings.

METHOD:: parent
	RETURNS:: An new instance of TreeViewItem representing the parent item.

METHOD:: childAt
	RETURNS:: A new instance of TreeViewItem representing the child item at code::index::.

METHOD:: addChild
	Appends a new child to this item.

	ARGUMENT:: strings
		An array of Strings (or nil), each for the text of one data field.
	RETURNS::
		An instance of TreeViewItem representing the new item.

METHOD:: insertChild
	Inserts a new child to this item at code::index::.

	ARGUMENT:: index
		The position at which to insert the child.
	ARGUMENT:: strings
		An array of Strings (or nil), each for the text of one data field.
	RETURNS::
		An instance of TreeViewItem representing the new item.

METHOD:: strings
	The text in the data fields.

	ARGUMENT:: strings
		An array of Strings (or nil), each for the text of one data field.

METHOD:: setString
	Sets the text in the given data field.

	ARGUMENT:: column
		An integer index of a data field.
	ARGUMENT:: string
		A String or nil.

METHOD:: colors
	The background colors of the data fields.

	ARGUMENT:: colors
		An array of Colors, each for the color of one data field.

METHOD:: setColor
	Sets the background color of the given data field.

	ARGUMENT:: column
		An integer index of a data field.
	ARGUMENT:: color
		A Color.

METHOD:: textColors
	The text colors of the data fields.

	ARGUMENT:: textColors
		An array of Colors, each for the color of one data field.

METHOD:: setTextColor
	Sets the text color of the given data field.

	ARGUMENT:: column
		An integer index of a data field.
	ARGUMENT:: color
		A Color.

METHOD:: setView
	Places another view into the given data field. Only one view can be placed into a data field at once. If a view is already present, it will be removed and destroyed.

	If the number of data fields decreases due to a call to link::Classes/TreeView#-columns::, the views contained in removed data fields will also be removed and destroyed.

	ARGUMENT:: column
		An integer index of a data field.
	ARGUMENT:: view
		A View.

METHOD:: removeView
	Removes the view from the given data field, if any.

	ARGUMENT:: column
		An integer index of a data field.

METHOD:: view
	The view in the given data field.

	ARGUMENT:: column
		An integer index of a data field.

METHOD:: ==
	Implements equality comparison between two TreeViewItem instances. Two instances are equal if they represent the same item in TreeView.

	RETURNS:: A Boolean.

METHOD:: isNull
	Whether the item is invalid. After an item is removed, all related TreeViewItem instances become invalid.

	RETURNS:: A Boolean.


EXAMPLES::

CODE::

(
t = TreeView().front;
t.columns_(["one", "two", "three"]);
t.addItem(["Alice", "Anna", "Anders"]);
t.addItem(["Bob", "Beatrice", "Benny"]);
t.addItem(["Cleo", "Conrad", "Cecilia"]);
)

i = t.itemAt(1);  //get an item

i.setString(1, "Hans");
i.setColor(1, Color.red);
i.setTextColor(1, Color.white);

i.addChild(["Bengt", "Bodil", "Ben"]);
i.strings;
i.childAt(0).strings;
::