Skip to content

Commit 96fa90c

Browse files
estebanlmdemarey
authored andcommitted
added class to simulate output and added it to waitWhile:
1 parent 0438768 commit 96fa90c

2 files changed

Lines changed: 25 additions & 0 deletions

File tree

src/Spec2-Adapters-Morphic/SpMorphicDialogWindowAdapter.class.st

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,10 @@ SpMorphicDialogWindowAdapter >> buildWidget [
5656
SpMorphicDialogWindowAdapter >> waitWhile: aBlock [
5757

5858
SpWindowForceOpenNonModal value ifTrue: [ ^ self ].
59+
SpWindowSimulateOpenModal value ifNotNil: [ :aValuable |
60+
aValuable value: self presenter.
61+
self presenter close.
62+
^ self ].
5963

6064
MorphicRenderLoop new doOneCycleWhile: aBlock
6165
]
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"
2+
To be used when I want the dialog to simulate a response instead of calling it.
3+
To be used, variable needs to be a block with an argument: the dialog itself.
4+
5+
Example:
6+
```smalltalk
7+
SpWindowSimulateOpenModal
8+
value: [ :aDialogPresenter |
9+
aDalogPresenter presenter inputText: 'The text of the sample'.
10+
aDialogPresenter beOk.
11+
true ]
12+
durying [ ""some code thet will call dialog openModal"" ]
13+
```
14+
"
15+
Class {
16+
#name : 'SpWindowSimulateOpenModal',
17+
#superclass : 'DynamicVariable',
18+
#category : 'Spec2-Core-Windows',
19+
#package : 'Spec2-Core',
20+
#tag : 'Windows'
21+
}

0 commit comments

Comments
 (0)