[plt-scheme] Changing the behavior of the run and debug button inDrScheme
Hi Robert,
Perhaps you could simply override the on-execute method in your module
language to make it initiate a connection. I believe such a
connection would be terminated automatically when you closed the tab
or clicked Run or Debug again. Would that work?
For an example of something similar, look at
collects/frtime/frtime-tool.ss, where the on-execute method is
overridden to extract some values from the program before it starts
running.
Cheers,
Greg
On Feb 18, 2008 6:41 AM, Robert Matovinovic <robert.matovinovic at web.de> wrote:
> Hi Greg,
> thanks for your hints. They will definitely help me. I looked already at the
> tools manual before I wrote the first mail but it didn't help me where
> actually to find the code which is executed, when the run button is clicked
> and how to extend/override it. So do you or anybody know where to look at?
> Robert
>
> -----Ursprüngliche Nachricht-----
> Von: plt-scheme-bounces at list.cs.brown.edu
> [mailto:plt-scheme-bounces at list.cs.brown.edu] Im Auftrag von Gregory Cooper
> Gesendet: Sonntag, 17. Februar 2008 21:37
> An: Robert Matovinovic
> Cc: plt-scheme at list.cs.brown.edu
> Betreff: Re: [plt-scheme] Changing the behavior of the run and debug button
> inDrScheme
>
>
>
> Hi Robert,
>
> Yes. You'll probably need to define a tool with mixins that extend various
> DrScheme classes.
>
> You can use drscheme:get/extend:extend-unit-frame to apply a mixin to the
> unit frame (the class for the top-level DrScheme window). The mixin can
> override the execute-callback method, which gets invoked when the user
> clicks Run or Debug.
>
> To run your startup code: the unit frame provides a current-tab method, to
> which you can send get-ints to get the associated interactions-text object.
> Once you have the interactions-text, you can send it
> run-in-evaluation-thread with a thunk containing the code you want to run.
>
> As far as running shutdown code, you can similarly use
> drscheme:get/extend:extend-tab to override enable-evaluation in the tab.
> (I'm pretty sure enable-evaluation gets invoked once all the definitions
> have been run, which should give you a suitable hook. Someone else can
> correct me if I'm wrong about this.)
>
> For examples of these mechanisms in use, you can look in
> collects/mztake/debug-tool.ss. There may be simpler examples, but that's
> where my experience comes from.
>
> Cheers,
> Greg
>
> On Feb 17, 2008 2:02 PM, Robert Matovinovic <robert.matovinovic at web.de>
> wrote:
> > Hi,
> > is it possible to change the behavior of the run and debug buttons in
> > DrScheme via a tool? I implemented a module language to control an
> > external program via DDE (this ancient Windows dynamic data exchange).
> > I would like to implement an automated connection setup to the
> > external program before the program in the definitions window in
> > executed or debugged and an automated disconnection afterwards, if
> > that language is chosen. Can anybody point me to the right files to
> > look at and what might be a good way to go? Thanks a lot. Robert
> > _________________________________________
> > Robert Matovinovic
> > Wintererstr. 61
> > 79104 Freiburg
> > Germany
> >
> > Tel: +49 (0)700 6286 0000
> > Cell: +49 (0)171 56 32 330
> > email: robert.matovinovic at web.de
> >
> >
> > ____________
> > Virus checked by G DATA AntiVirusKit
> > Version: AVK 18.2756 from 13.02.2008
> > Virus news: www.antiviruslab.com
> >
> > _________________________________________________
> > For list-related administrative tasks:
> > http://list.cs.brown.edu/mailman/listinfo/plt-scheme
> >
> _________________________________________________
> For list-related administrative tasks:
> http://list.cs.brown.edu/mailman/listinfo/plt-scheme
>
>
> ____________
> Virus checked by G DATA AntiVirusKit
> Version: AVK 18.2756 from 13.02.2008
> Virus news: www.antiviruslab.com
>
>