My local docs gave a 0-arg method. See attached. 



On Apr 22, 2016, at 9:16 AM, Robby Findler <ro...@eecs.northwestern.edu> wrote:

> These docs seem right:
> 
> http://docs.racket-lang.org/framework/Frame.html?q=file-menu%3Abetween#%28meth._%28%28%28lib._framework%2Fmain..rkt%29._frame~3aeditor-mixin%29._edit-menu~3abetween-select-all-and-find%29%29
> 
> Robby
> 
> 
> On Fri, Apr 22, 2016 at 7:52 AM, Matthias Felleisen
> <matth...@ccs.neu.edu> wrote:
>> 
>> If you modify your sample code like this,
>> 
>> #lang racket/gui
>> 
>> (require framework)
>> 
>> (define ext-frame%
>>  (frame:standard-menus-mixin
>>   (frame:status-line-mixin frame:basic%)))
>> 
>> (define shc-frame%
>>  (class ext-frame%
>>    (super-new)
>>    (define/override (edit-menu:create-clear?) #f)
>>    (define/override (edit-menu:between-select-all-and-find _)
>>      (super edit-menu:between-select-all-and-find 10)
>>      (new menu-item%
>>           [parent (list-ref (send (send this get-menu-bar) get-items) 1)]
>>           [label "Patch"]
>>           [callback (lambda (menu event)
>>                       (send this show #t))])))) ; The callback is just a 
>> placeholder for now.
>> 
>> (define test-frame (new shc-frame%
>>                        [label "TEST!"]
>>                        [height 200]
>>                        [width 200]))
>> 
>> you find out that (1) the method really takes one argument and (2) that it 
>> expects a menu:
>> 
>>> expected: (or/c (is-a?/c menu%) (is-a?/c popup-menu%))
>>>  given: 10
>> 
>> What this means is that someone added contracts to the method as it was 
>> implemented
>> and that the docs are wrong.
>> 
>> -- Matthias
>> 
>> 
>> 
>> 
>> On Apr 22, 2016, at 8:46 AM, Bruce Steinberg <bruc...@gmail.com> wrote:
>> 
>>> I'm having trouble with overriding one of framework's methods to add a menu 
>>> item. Here's what I'm currently doing:
>>> 
>>>    #lang racket/gui
>>> 
>>>    (require framework)
>>> 
>>>    (define ext-frame%
>>>        (frame:standard-menus-mixin
>>>        (frame:status-line-mixin frame:basic%)))
>>> 
>>>    (define shc-frame%
>>>      (class ext-frame%
>>>        (super-new)
>>>        (define/override (edit-menu:create-clear?) #f)
>>>        (define/override (edit-menu:between-select-all-and-find)
>>>          (new menu-item%
>>>               [parent (list-ref (send (send this get-menu-bar) get-items) 
>>> 1)]
>>>               [label "Patch"]
>>>               [callback (lambda (menu event)
>>>                           (send this show #t))])))) ; The callback is just 
>>> a placeholder for now.
>>> 
>>>    (define test-frame (new shc-frame%
>>>                            [label "TEST!"]
>>>                            [height 200]
>>>                            [width 200]))
>>> 
>>> When I run the program I get the following error:
>>> 
>>>    edit-menu:between-select-all-and-find method in shc-frame%: arity 
>>> mismatch;
>>>     the expected number of arguments does not match the given number
>>>      expected: 0
>>>      given: 1
>>>      arguments...:
>>>       (object:...ork/private/menu.rkt:33:4 ...)
>>> 
>>> Sorry if I'm missing something basic. I'm fairly new to programming.
>>> 
>>> Thanks so much.
>>> 
>>> -Bruce
>>> 
>>> --
>>> 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.

-- 
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.

Reply via email to