[racket-users] Run Button interaction
Hello, I am writing a plugin that tracks the development of code. Currently I want to save the times the run button is pressed (i.e. the code is executed). How can I access when the run button is pressed? Additionally I'd like to mark when the code is saved under a new name (as a new .rkt file). Thanks in advance Loone. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Run Button interaction
> On Aug 2, 2016, at 6:02 AM, Normal Loone wrote: > > Hello, > > I am writing a plugin that tracks the development of code. Currently I want > to save the times the run button is pressed (i.e. the code is executed). > How can I access when the run button is pressed? > > Additionally I'd like to mark when the code is saved under a new name (as a > new .rkt file). Take a look at the “DrRacket Plugins” manual, probably available on your own machine as part of the installed docs (try hitting the F1 key in DrRacket), or by visiting http://docs.racket-lang.org/tools/index.html Apologies if you already knew about this resource! Best, John Clements -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout. signature.asc Description: PGP signature
Re: [racket-users] Run Button interaction
Hi, The DrRacket tools documentation is good but I don't think it answers this sort of question. You may find the right 'hook' in the Racket GUI Application Framework http://docs.racket-lang.org/framework/index.html I'd start with searching the source of the translations file (strings I think) to find where 'run' is called in the code. You may then be able to use one of the functions documented in 'get-extend' ( http://docs.racket-lang.org/tools/drracket_get_extend.html ) to capture the run button. Similar process for file renaming events but you probably need 'drracket:get/extend:extend-tab'. This stuff *is* tricky and hard to find in the manuals. Stephen On Tue, 2 Aug 2016 at 18:41, 'John Clements' via Racket Users < racket-users@googlegroups.com> wrote: > > > On Aug 2, 2016, at 6:02 AM, Normal Loone wrote: > > > > Hello, > > > > I am writing a plugin that tracks the development of code. Currently I > want to save the times the run button is pressed (i.e. the code is > executed). > > How can I access when the run button is pressed? > > > > Additionally I'd like to mark when the code is saved under a new name > (as a new .rkt file). > > Take a look at the “DrRacket Plugins” manual, probably available on your > own machine as part of the installed docs (try hitting the F1 key in > DrRacket), or by visiting > > http://docs.racket-lang.org/tools/index.html > > Apologies if you already knew about this resource! > > Best, > > John Clements > > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Kind regards, Stephen -- Bigger than Scheme, cooler than Clojure & more fun than CL.(n=1) -- -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Run Button interaction
I tried (define/augment (execute-callback) ...) So I'd just use another additional function of mine when the run button is used, but execute-callback is apparently not augmentable? At least I got an error message stating that. Is there another function that you can modify? -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Run Button interaction
Did you try (define/override ... ? Robby On Thu, Aug 4, 2016 at 9:41 AM, Normal Loone wrote: > I tried > > (define/augment (execute-callback) > ...) > > So I'd just use another additional function of mine when the run button is > used, but execute-callback is apparently not augmentable? At least I got an > error message stating that. > > Is there another function that you can modify? > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Run Button interaction
My apologies - it is in the tools docs: http://docs.racket-lang.org/tools/drracket_unit.html#%28meth._%28%28%28lib._drracket%2Ftool-lib..rkt%29._drracket~3aunit~3aframe~25%29._execute-callback%29%29 On Thu, 4 Aug 2016 at 15:43, Robby Findler wrote: > Did you try > > (define/override ... > > ? > > Robby > > > On Thu, Aug 4, 2016 at 9:41 AM, Normal Loone > wrote: > > I tried > > > > (define/augment (execute-callback) > > ...) > > > > So I'd just use another additional function of mine when the run button > is used, but execute-callback is apparently not augmentable? At least I got > an error message stating that. > > > > Is there another function that you can modify? > > > > -- > > You received this message because you are subscribed to the Google > Groups "Racket Users" group. > > To unsubscribe from this group and stop receiving emails from it, send > an email to racket-users+unsubscr...@googlegroups.com. > > For more options, visit https://groups.google.com/d/optout. > > -- > You received this message because you are subscribed to the Google Groups > "Racket Users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to racket-users+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/d/optout. > -- Kind regards, Stephen -- Bigger than Scheme, cooler than Clojure & more fun than CL.(n=1) -- -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.
Re: [racket-users] Run Button interaction
> On Aug 8, 2016, at 1:19 AM, Normal Loone wrote: > > I tried using override instead of augment, and it works. > Problem is: It overrides it now ofc, which means the program is no longer > evaluated. If you want to override a method, but still perform its behavior, just invoke it using super[1]. In your case, it would look something like this: (define/override (execute-callback) (my-own-program) (super execute-callback)) [1]: http://docs.racket-lang.org/reference/createclass.html#%28form._%28%28lib._racket%2Fprivate%2Fclass-internal..rkt%29._super%29%29 -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.