【问题标题】:Folder icons does not appeared in Open File Dialog Box打开文件对话框中不显示文件夹图标
【发布时间】:2017-02-28 02:01:18
【问题描述】:

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

#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))))]))

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

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

【问题讨论】:

    标签: user-interface dialog scheme lisp racket


    【解决方案1】:

    如果您只想使用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找到)

    【讨论】:

      猜你喜欢
      • 2010-11-08
      • 1970-01-01
      • 1970-01-01
      • 2018-02-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多