[plt-scheme] on-execute method in drscheme:language:language<%>

From: Robby Findler (robby at cs.uchicago.edu)
Date: Fri Jun 16 11:16:49 EDT 2006

I'm not sure how to answer, because I think I'm missing some content:
what do you want to do in a little bit more global sense? Still, some minor comments below.

At Fri, 16 Jun 2006 11:03:54 -0400, "Carl Eastlund" wrote:
> On 6/16/06, Dale Vaillancourt <dalev at ccs.neu.edu> wrote:
> > I am working on a language-level for DrScheme, and I need to do some
> > computation when 'Run' is clicked (before allowing the user to
> > interact with functions appearing in the definitions window).
> >
> > I thought that the right method to override would be on-execute in
> > drscheme:language:language<%>, but that method gets invoked more
> > often that I want.  In addition to being invoked upon clicking 'Run',
> > it also is invoked upon opening a file in DrScheme (when my language
> > has already been selected).

But the "Run" button is (implicitly) clicked at this point, with an
empty program. In particular, the REPL is now active.

> > Is there another method that only gets invoked upon clicking 'Run'?
> > Alternatively, is there a way to determine, within the body of on-
> > execute, whether the invocation was triggered by the 'Run' button?
> >
> > (BTW, I am using version 349.100-svn15jun2006.)
> 
> I think you want the execute-callback method of drscheme:unit:frame%.
> See also drscheme:get/extend:extend-unit-frame.

Keep in mind that that method is invoked on drscheme's eventspace's
main thread, not on the user's thread. (So, I doubt you want this.)

Robby



Posted on the users mailing list.