[racket] Intended behavior of get-font method on control<%>?

From: Asumu Takikawa (asumu at ccs.neu.edu)
Date: Thu Sep 2 12:22:53 EDT 2010

Hi all,

I have been working on contracting classes in MrEd and I've stumbled on what
seems to be an inconsistency in documentation. 

The docs for control<%> lists the following method contract:

   (send a-control get-font) → (is-a?/c font%)

but if you try this on a button%, you'll get a funny result.

  $ (send (make-object button% "Press me" (make-object frame% "Foo")) get-font)
  . . procedure get-font method in basic-control%: expects 1 argument, given 0

button% appears to be implemented through basic-control%, but basic-control% in
turn just throws away the parameter in the implementation:

[get-font (lambda (e) (send wx get-font))] (line 77, mritem.rkt)

If you try calling the method with a parameter you get this:

  $ (send (make-object button% "Press me" (make-object frame% "Foo")) get-font "junk")
  . . send: no such method: get-font for class: ...private/wxwindow.rkt:136:4

Does anyone know what the intended behavior for this method is?


Posted on the users mailing list.