[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

RE: MysterX Message Loop?



> You're thinking about the problem differently than I am. The pdf on MysterX
> points out that in some ways MysterX is superior to MrEd. If you follow
> that line of thinking, creating a user interface with MysterX should be
> similar to creating one with MrEd. So... why does MysterX actually force
> its windows to be created in a separate thread? Why not create them in the
> main thread unless the user specifies otherwise, just as MrEd does?

The separate thread is needed to process Windows events.
When you create a new MrEd window, it uses the underlying
wxWindows mechanisms used by MrEd itself to handle Windows events.
MysterX windows need to do their own event processing.

I believe that MrEd also separates the REPL thread from threads used 
by programs.  The difference appears to be that MrEd doesn't 
shut down when MrEd threads have any pending events left, 
using the mechanism described by Robby Findler.  So the differences 
are perhaps not so great, after all.

-- Paul






In MrEd 


browser windows need to process Windows events directly,
where MrEd windows 


> 
> There may be a technical reason behind the decision, but maybe not. You
> pointed out that you always launch the demo from the REPL, and that seems
> natural to you; I'm thinking in terms of double-clickable apps, and that
> seems natural to me. Different premises, different conclusions.
> 
> ps: Presumably MrEd already has a concept similar to your "I'm alive" idea,
> because it doesn't shutdown until the last window is gone. Something may
> need to change to expose that, but the concept seems to already exist
> somewhere. Ah... but that still presupposes that MysterX launches in the
> main thread!
>