类型化Racket扩展gui类

类型化Racket扩展gui类,racket,typed-racket,Racket,Typed Racket,我想扩展类水平面板%,但不知怎的,我收到了以下错误消息: class has init `stretchable-height' that is not in expected type in: (class horizontal-panel% (super-new)) 这是我目前的代码: #lang typed/racket (require typed/racket/gui) (define-type Graph-Tab% (Class #:implements Horizonta

我想扩展类
水平面板%
,但不知怎的,我收到了以下错误消息:

class has init `stretchable-height' that is not in expected type in: (class horizontal-panel% (super-new))
这是我目前的代码:

#lang typed/racket
(require typed/racket/gui)

(define-type Graph-Tab%
  (Class #:implements  Horizontal-Panel%

         ))
(: graph-tab% : Graph-Tab%)
(define graph-tab%
  (class horizontal-panel%
    (super-new)

    ))

正如你可能知道的,我对racket非常陌生,我还在学习。

我很确定错误消息的意思是,你需要“初始化”该类的所有内容

一种有用的方法是在类型定义中从
:implements
更改为
:implements/inits
,并对缺少的值调用init(在本例中为
可拉伸高度

如果你不知道这些是什么,你可以简单地把
(initrest)
放进去,这样就可以了


(这是和的文档)

我的回答有帮助吗?