Hi Offray,
some notes about your code:
browser
�� �� �� �� act: [:newNode |
�� �� �� �� �� �� �� �� �� �� �� �� newNode := UbakyeNode
�� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� header: 'nuevoNodo' body: ''.
�� �� �� �� �� �� �� �� �� �� �� �� mainTree addNode: newNode.]��
this would change the block parameter "newNode", but the block parameter is supposed to deliver the object you'll act on, the browser for example.
I think you wanted to write this code:
browser
�������������� act: [ :b�� | |newNode|
���������������������������������������������� newNode := UbakyeNode
���������������������������������������������� header: 'nuevoNodo' body: ''.
���������������������������������������������� b entity addNode: newNode .
if you call "b update" like you did in the "remove action" your browse tree update will work.
changing OrderedCollection to GLMAnnouncingCollection should work, but you'll have to define
the appropiate announcer source #children instead of #yourself. #yourself gives the mainTree, and that
does not work as your mainTree is not a GLMAnnouncingCollection.
updateOn: GLMItemAdded from: #children
There are two things I don't understand
1.
setting updateOn: on the browser does not work:
browser updateOn: GLMItemAdded from: #children.
but setting it on the tree
(browser transmit)
�������������� to: #preview;
�������������� andShow: [ :a |��
������������������������������ a tree
"-->"�������� updateOn: GLMItemAdded from: #children;
���������������������������������������������� title: mainTree header;
���������������������������������������������� children: [:eachNode | eachNode children ];
���������������������������������������������� format: [:eachNode | eachNode header ].
������������������������������ a text
���������������������������������������������� title: 'Text'].
2. is there a way to get the currently selected tree node? Otherwise
all new nodes only added to the first node.
There are plenty of examples, but no one with add/remove or selection on trees.