[racket] DrRacket extend-unit-frame augment on-tab-change not being called

From: Nick Main (david.nick.main at gmail.com)
Date: Mon Apr 1 18:15:26 EDT 2013

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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20130401/5acb33de/attachment.html>

Posted on the users mailing list.