[racket] DrRacket extend-unit-frame augment on-tab-change not being called
Which version of Racket are you using?
The current (git) version of Optimization Coach[1] calls `inner' as it
should. I fixed that bug some time ago.
Sorry for the trouble.
Vincent
[1] Now a PLaneT2 package. Starting with the next Racket release,
Optimization Coach will be distributed separately from Racket.
At Mon, 1 Apr 2013 15:15:26 -0700,
Nick Main wrote:
>
> [1 <multipart/alternative (7bit)>]
> [1.1 <text/plain; ISO-8859-1 (7bit)>]
> I edited the source for the optimization coach and to comment out the
> "define/augment on-tab-change" and my augment is now working !
>
> I will file a bug for this.
>
>
>
> On Mon, Apr 1, 2013 at 2:40 PM, Nick Main <david.nick.main at gmail.com> wrote:
>
> > I am writing a DrRacket plugin and want to react to tab changes. I am
> > augmenting the on-tab-change method, as shown below, but this augmentation
> > is not being invoked when tabs are changed.
> >
> > Is there anything obviously wrong with this approach ?
> >
> > I looked through the Racket source and noticed that the optimization coach
> > does not call (inner (void) on-tab-change from-tab to-tab) in its
> > (define/augment (on-tab-change from-tab to-tab)... - but changing the
> > before? argument for my extension to #t does not make a difference, so that
> > may be a red-herring.
> >
> > #lang racket/gui
> > (require drracket/tool)
> >
> > (provide tool@)
> >
> > (define tool@
> > (unit
> > (import drracket:tool^)
> > (export drracket:tool-exports^)
> > (define (phase1) (void))
> > (define (phase2) (drracket:get/extend:extend-unit-frame frame-mixin)
> > #f)
> >
> > (define frame-mixin
> > (mixin (drracket:unit:frame<%>) (drracket:unit:frame<%>)
> >
> > (define/augment (on-tab-change from-tab to-tab)
> > (inner (void) on-tab-change from-tab to-tab)
> > (printf "TAB-CHANGE\n"))
> >
> > (printf "AUGMENTED !\n") ;sanity check
> >
> > (super-new)))))
> >
> > --Nick
> >
> [1.2 <text/html; ISO-8859-1 (quoted-printable)>]
>
> [2 <text/plain; us-ascii (7bit)>]
> ____________________
> Racket Users list:
> http://lists.racket-lang.org/users