gtk: get-file' and
put-file' replace "*.*" filter with "*"
Closes PR 11593
This commit is contained in:
parent
9ffb204682
commit
9417beb7bd
|
@ -86,8 +86,11 @@
|
||||||
(for ([f (in-list filters)])
|
(for ([f (in-list filters)])
|
||||||
(match f
|
(match f
|
||||||
[(list name glob)
|
[(list name glob)
|
||||||
(let ([ff (gtk_file_filter_new)])
|
(let ([ff (gtk_file_filter_new)]
|
||||||
(gtk_file_filter_set_name ff name)
|
[glob (if (equal? glob "*.*") "*" glob)])
|
||||||
|
(gtk_file_filter_set_name ff (if (equal? glob "*")
|
||||||
|
name
|
||||||
|
(format "~a (~a)" name glob)))
|
||||||
(gtk_file_filter_add_pattern ff glob)
|
(gtk_file_filter_add_pattern ff glob)
|
||||||
(gtk_file_chooser_add_filter dlg ff))]))
|
(gtk_file_chooser_add_filter dlg ff))]))
|
||||||
(define ans (and (eq? 'accept (show-dialog dlg))
|
(define ans (and (eq? 'accept (show-dialog dlg))
|
||||||
|
|
|
@ -57,6 +57,7 @@ Under Windows and X, @scheme[filters] determines a set of filters from
|
||||||
which the user can choose in the dialog. Each element of the
|
which the user can choose in the dialog. Each element of the
|
||||||
@scheme[filters] list contains two strings: a description of the filter
|
@scheme[filters] list contains two strings: a description of the filter
|
||||||
as seen by the user, and a filter pattern matched against file names.
|
as seen by the user, and a filter pattern matched against file names.
|
||||||
|
Under X, a @racket["*.*"] pattern is implicitly replaced with @racket["*"].
|
||||||
|
|
||||||
See also @scheme[path-dialog%].
|
See also @scheme[path-dialog%].
|
||||||
|
|
||||||
|
@ -115,7 +116,7 @@ Under Windows, if @scheme[extension] is not @scheme[#f], the returned path
|
||||||
@scheme[extension] is used as the default extension when the user's
|
@scheme[extension] is used as the default extension when the user's
|
||||||
@scheme[filters] choice has the pattern @scheme["*.*"]. Meanwhile, the
|
@scheme[filters] choice has the pattern @scheme["*.*"]. Meanwhile, the
|
||||||
@scheme[filters] argument has the same format and auxiliary role as for
|
@scheme[filters] argument has the same format and auxiliary role as for
|
||||||
@scheme[get-file]. In particular, if the only pattern in @scheme[filters]
|
@scheme[get-file]. In particular, if the only pattern in @scheme[filters]
|
||||||
is @scheme[(string-append "*." extension)], then the result pathname is guaranteed
|
is @scheme[(string-append "*." extension)], then the result pathname is guaranteed
|
||||||
to have an extension mapping @scheme[extension].
|
to have an extension mapping @scheme[extension].
|
||||||
|
|
||||||
|
@ -136,8 +137,8 @@ Under Mac OS X versions before 10.5, the returned path will get a
|
||||||
@scheme[filters] contains only @scheme[(string-append "*."
|
@scheme[filters] contains only @scheme[(string-append "*."
|
||||||
extension)].
|
extension)].
|
||||||
|
|
||||||
The @scheme[extension] argument is ignored under X, and
|
Under X, @racket[extension] is ignored, and @racket[filters] is used
|
||||||
@scheme[filters] can be used to specify glob-patterns.
|
to filter the visible list of files as in @racket[get-file].
|
||||||
|
|
||||||
The @scheme[style] list is treated as for @scheme[get-file].
|
The @scheme[style] list is treated as for @scheme[get-file].
|
||||||
|
|
||||||
|
@ -171,8 +172,6 @@ specified. The latter
|
||||||
``.app'') that the Finder normally displays like a file.
|
``.app'') that the Finder normally displays like a file.
|
||||||
|
|
||||||
See also @scheme[path-dialog%].
|
See also @scheme[path-dialog%].
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@defproc[(message-box [title label-string?]
|
@defproc[(message-box [title label-string?]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user