2017-02-28 57 views
0

我试图使用这些代码的对话框中打开文件,文件夹图标不会出现在打开文件对话框

#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

回答