hpi-swa/vivide

Writing text properties with ViTreeView

Opened this issue · 0 comments

The text selector will be overwritten via textSelector: #youself and thus the view cannot write into the model:

...
(UiItemViewColumnSpec newFrom: (#(icon color morph balloonText checkable checked editable selectable)
	collect: [:p | p -> ('{1}_{2}' format: {idx.p}) asSymbol]))
		"Provide print-string default if text property is missing."
		textSelector: #yourself; "<--- this is wrong!"
		textConverter: [:node | 
			| allBold text |
			allBold := node at: ('{1}_bold' format: {idx}) asSymbol ifAbsent: [false].
			text := (node at: ('{1}_text' format: {idx}) asSymbol ifAbsent: [node object printString]).
			allBold ifFalse: [text] ifTrue: [text asText addAttribute: TextEmphasis bold; yourself]							];
...

See UiItemViewColumnSpec >> #editorFinisher :

^ editorFinisher ifNil: [editorFinisher := [:editor :node |
	node perform: (self textSelector, #:) asSymbol withArguments: {editor theText}]].