Skip to content

Commit

Permalink
cleanup(morphic dependencies): move towards removing morphic dependen…
Browse files Browse the repository at this point in the history
…cies

Use inform from the application in the example
Do not use #inspectSubInstances and co, that allow escaping from spec.
  • Loading branch information
guillep committed Nov 6, 2024
1 parent 1b290cb commit 6036a63
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Spec2-Commands/SpBrowseInstancesCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ SpBrowseInstancesCommand class >> shortName [
{ #category : 'executing' }
SpBrowseInstancesCommand >> execute [

self target instanceSide inspectAllInstances
self target instanceSide allInstances inspect
]
2 changes: 1 addition & 1 deletion src/Spec2-Commands/SpBrowseSubInstancesCommand.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,5 @@ SpBrowseSubInstancesCommand class >> shortName [
{ #category : 'executing' }
SpBrowseSubInstancesCommand >> execute [

self target instanceSide inspectSubInstances
self target instanceSide allSubInstances inspect
]
6 changes: 4 additions & 2 deletions src/Spec2-ListView/SpListViewPresenter.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,10 @@ SpListViewPresenter class >> exampleWithIconsAndMorph [
It shows also the fact you can put any presenter inside, giving a huge power
to your lists."

| application |
application := SpApplication new useBackend: #Gtk.
^ self new
application: (SpApplication new useBackend: #Gtk);
application: application;
items: self environment allClasses;
setup: [ :aPresenter |
| presenter morph |
Expand All @@ -157,7 +159,7 @@ SpListViewPresenter class >> exampleWithIconsAndMorph [
morph: ((morph := SimpleButtonMorph new)
color: Color blue;
target: [
self inform: 'Clicked: ', morph label ];
application inform: 'Clicked: ', morph label ];
actionSelector: #value;
yourself);
yourself);
Expand Down

0 comments on commit 6036a63

Please sign in to comment.