This should work
run [
<category: 'services'>
| signals sema answer modal destroyed |
destroyed := false.
sema := Semaphore new.
modal := self getModal.
self setModal: true.
signals := {
self
connectSignal: 'response'
to: [ :dialog :integer | answer := integer. sema signal ]
selector: #'value:value:'.
self
connectSignal: 'unmap'
to: sema
selector: #signal.
self
connectSignal: 'delete-event'
to: [ :dialog :event | answer := Gtk
gtkResponseDeleteEvent. sema signal. true ]
selector: #'value:value:'.
self
connectSignal: 'destroy'
to: [ destroyed := true. true ]
selector: #value }.
self showAll.
Processor activeProcess detach.
sema wait.
destroyed ifFalse: [
self
setModal: modal;
hideAll.
signals do: [ :each | self disconnectSignal: each ] ].
^ answer
]
On Wed, Aug 25, 2010 at 10:54 AM, Paolo Bonzini <[email protected]> wrote:
> On 08/25/2010 10:51 AM, Gwenaël Casaccio wrote:
>>
>> Ok I understand the problem, run message launches a new inner loop.
>> But with our gtk event loop we should use showAll, showModalOnAnswer:, ...
>
> Hmm, #run is overridden by GtkImpl.st to not use a new event loop. It uses
> a Smalltalk semaphore and the outer event loop. Since events are run in
> their own Process, everything should work without blocking the outer event
> loop.
>
> Paolo
>
_______________________________________________
help-smalltalk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/help-smalltalk