“打开文件”对话框中未显示文件夹图标

时间:2017-02-28 02:01:19

标签: user-interface dialog scheme lisp racket

我正在尝试使用这些代码从对话框中打开文件,

#lang racket/gui
(require racket/gui/base
        framework
        mrlib/path-dialog)

(define top-frame (new frame%
                   [label "The Frame"]
                   [min-width 200]
                   [min-height 100]
                   [alignment (list 'center 'center)]))
(send top-frame show #t)

(define open (new path-dialog%
                  [existing? #t]
                  [filters (list (list "My Documents" "*.docx")
                                 (list "Text Files" "*.txt"))]))

(define open-button
  (new button%
       [label "Open File"]
       [parent top-frame]
       [callback (lambda (b e)
                   (define input-port-or-not (send open run))
                   (when input-port-or-not
                     (message-box "open dialog" (format "Dialog box is open.") #f '(ok no-icon))))]))

我得到这个没有文件夹图标的打开文件对话框

enter image description here

如何更改以获得对话框的外观,如下图所示,显示文件夹图标?

enter image description here

1 个答案:

答案 0 :(得分:0)

如果您只想使用mrlib/path-dialog,我认为不可能。

但是,这里有代码:https://www.apt-browse.org/browse/ubuntu/trusty/universe/all/racket-common/5.3.6%2Bdfsg1-1/file/usr/share/racket/collects/mred/private/path-dialog.rkt。通过修改此文件,您可以获得所需的内容。

(如果您使用Linux,则可以在/usr/share/racket/pkgs/gui-lib/mred/private/path-dialog.rkt

找到该文件