Squeak
  links to this page:    
View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide
PluggableMultiColumnListMorph
Last updated at 6:26 pm UTC on 15 October 2019
 PluggableListMorph subclass: #PluggableMultiColumnListMorph
	instanceVariableNames: 'listMorphs'
	classVariableNames: ''
	poolDictionaries: ''
	category: 'Morphic-Pluggable Widgets'

In Squeak 5.3a (example from mailing list 15th Oct 2019)

model := {
	SystemNavigation default allClasses collect: #name.
	SystemNavigation default allClasses collect: #category.
}.

view := PluggableMultiColumnListMorph
	on: model
	list: #yourself
	selected: nil
	changeSelected: nil.

view extent: 200@300.
view listFilterSet: 'Hand'.

view openInHand.

"Play around with horizontal alignment."
view listMorphs first cellPositioning: #rightCenter.
view listMorphs second cellPositioning: #center.
view listMorphs do: [:col | col cellPositioning: #leftCenter].

"Play around with margins."
view listMorphs do: [:col | col cellInset: 0].
view listMorphs do: [:col | col cellInset: 3@0].
view listMorphs do: [:col | col cellInset: 5].

"Funny but not useful."
view listMorphs first cellInset: 3. view listMorphs second cellInset: 0.

"Fit all contents."
view listMorphs do: [:col | col
	hResizing: #shrinkWrap;
	vResizing: #shrinkWrap]. "always set anyway"
view
	hResizing: #shrinkWrap;
	vResizing: #shrinkWrap.
	
"Enable horizontal scrolling"
view
	hResizing: #rigid;
	hScrollBarPolicy: #whenNeeded;
	width: 100.

"Disable horizontal scrolling"
view hScrollBarPolicy: #never.

"Enable vertical scrolling"
view
	vResizing: #rigid;
	vScrollBarPolicy: #whenNeeded;
	height: 600.

"Disable vertical scrolling"
view vScrollBarPolicy: #never.


PluggableMultiColumnListMorph.png

An example with 3 columns
model := {
	SystemNavigation default allClasses collect: #name.
	SystemNavigation default allClasses collect: #category.
	SystemNavigation default allClasses collect: [:cls | cls subclasses size]
}.

view := PluggableMultiColumnListMorph
	on: model
	list: #yourself
	selected: nil
	changeSelected: nil.

view extent: 800@300.
view listFilterSet: ''.
view openInHand.