On 14 déc. 2009, at 22:11, Johan Fabry wrote:
On 14 Dec 2009, at 12:16, Tudor Girba wrote:
I understand the sendToOutside: part, but I dont see how the outside receives these selection messages and can store the selections, e.g. in a local variable. Can you enlighten me here?
When you have multiple #from: statements, you will get multiple variables in the #display: block. Something like this: outerBrowser showOn: #main; fromOutside: #entity; from: #properties->#selectedCHeight; #properties->#selectedCWidth; using: [ browser mondrian painting: [:view :cheight :cwidth | ... ] ]
OK we are almost there ... one last hitch (see test code below). if I dont add allowNil the text browser only shows text if all 6 lists have a selection. I want to be able to have a list without selection (= no metric), so I added allowNil, but that always shows the text nilnilnilnilnilnil . How do I fix this? Thanks in advance!
| browser |
browser := GLMTabulator new. browser row: #selections; row: #selectionStatus. browser showOn: #selections; using: [browser custom: AMUI new propertiesSelector2 ].
browser showOn: #selectionStatus; from: #selections->#selCwidth; from: #selections->#selCheight; from: #selections->#selAwidth; from: #selections->#selAheight; from: #selections->#selMwidth; from: #selections->#selMheight; using: [browser text display: [ :cw :ch :aw :ah :mw :mh | ch asString, cw asString , ah asString, aw asString, mh asString, mw asString]; allowNil ].
Usually one inserts a when: clause to activate the pane when a specific parameter is not nil (because at least one should be not nil to display something). But in your case it seems different: the status is always active, but it should filter the nil in its display: block
Something like (warning, not tested!)
using: [browser text display: [ :cw :ch :aw :ah :mw :mh | {cw. ch. aw. ah. mw. mh} select: #notNil thenCollect: #asString ]; allowNil ].
-- Simon