无法隐藏编辑菜单中的“首选项”项

时间:2016-06-30 09:54:36

标签: user-interface menu frameworks scheme racket

当“撤消和重做”项目能够隐藏时,如何隐藏this picture中的“首选项”项?我尝试使用(首选项:隐藏对话框),但GUI没有区别。

#lang racket/gui
(require framework)

(define menu-super-frame% 
  (frame:standard-menus-mixin   
   frame:basic%))

    (define menu-frame%
      (class menu-super-frame%
        (inherit get-file-menu set-icon)
        ;hiding items in edit menu
        (define/override (edit-menu:create-undo?) #f)
        (define/override (edit-menu:create-redo?) #f)            
        (super-new)))

    (define top-frame 
      (new menu-frame%
       [label "Main Window"]
       [width 200]
       [height 200]
       [alignment (list 'left 'top)]))

1 个答案:

答案 0 :(得分:1)

使用

(define/override (edit-menu:create-preferences?) #f) 

注意:我还没有测试它是否有效,但是在代码中挖掘显示以下内容已经定义:

                file-menu:create-new?
                file-menu:create-open?
                file-menu:create-open-recent?
                file-menu:create-revert?
                file-menu:create-save?
                file-menu:create-save-as?
                file-menu:create-print?
                edit-menu:create-undo?
                edit-menu:create-redo?
                edit-menu:create-cut?
                edit-menu:create-paste?
                edit-menu:create-clear?
                edit-menu:create-find?
                edit-menu:create-preferences?