2016-06-07 8:21 GMT+02:00 Peter Uhnak <i.uh...@gmail.com>: > 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. >
With a spec window, you can try to open it modal WindowModel>>#modalRelativeTo: aWindow > 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 > >