[plt-scheme] Grafting a console onto universe, hackety hack.
On Jun 2, 2010, at 7:19 PM, Jordan Johnson wrote:
> 1) whether there's a decent (and minimally intrusive) way to hook into
> universe to trigger events from this console -- polling a state variable
> in the tick handler is kinda icky
I am trying to figure what exactly you're trying to achieve.
I have parameterized the 'world' over many things with mixins
and all, but I have not considered a reuse where you want to
bring events from somewhere else. I think it should be possible
to expose some private interface -- if I knew what you wanted.
> 2) whether there's any locking I'd need to do to make it safe for both the
> user-input-callback (see below) and a universe/big-bang event handler
> callback to call append-line as I'm doing below
When you write GUI programs, you are writing concurrent programs.
There are at least two processes involved: your program and the person
sitting at the console.
> 3) whether overriding on-char is really an OK way to make a text% object
> "read-only" from the user's perspective
(send text lock #t)
> 4) whether there's already some spiffy console-style class I've missed in
> the docs :)
Again, what are you trying to do?
One could imagine factoring it out the drracket console.