I'm a simple tab panel, that can be styled with stylesheets. New tabs can be added using #add:label:
ProtoObjectObjectWAPresenterWAComponentWANavigationWASimpleNavigation
| components |
| instance | class |
|---|---|
| accessing behavior initialize rendering | example |
| components |
|---|
| accessing |
|---|
| children |
^Array with: self selectedComponent. |
| labels |
"Return the tabs labels" ^ self options |
| options |
^ components collect: [:ea | ea key] |
| selectedComponent |
^ (components detect: [:ea | ea key = self selection] ifNone: [^ nil]) value |
| behavior |
|---|
| add: aComponent label: aString |
components add: aString -> aComponent |
| initialize |
|---|
| initialize |
super initialize. components _ OrderedCollection new |
| rendering |
|---|
| renderSelectionOn: html |
html render: self selectedComponent |
| example |
|---|
| example |
^self new add: WACounter example label: 'Counter'; add: WAPath example label: 'Path'; select: 'Counter'; yourself. |