[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 17:40:31 EDT 2013

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/691fc476/attachment.html>

Posted on the users mailing list.