|
Hi,
is it possible to return "synchronously" even if I have an asynchronous message?
For example:
SomeObject>>someMethod
^ UIManager default chooseFrom: #(a b c)
When the above method is executed, it will open a popup and block the execution until I select something, then it will return the selection.
But if I instead have something like this
SomeObject>>otherMethod
|choice|
NewListModel new
items: #(a b c);
whenSelectedItemChanged: [ :item | choice := item ];
openDialogWithSpec.
choice.
Then it will open the window but it will immediately return nil.
So my question is: is it possible to synchronously return even in the second example / block the flow until a selection is made?
Thanks,
Peter
|