找回密码
 立即注册

扫一扫,访问微社区

QQ登录

只需一步,快速开始

查看: 4941|回复: 1

[求助] WxPython FileDialog的wildcard参数问题

1

主题

2

帖子

7

积分

贫民

积分
7
xiaogg0808 发表于 2014-6-14 10:27:16 | 显示全部楼层 |阅读模式
请教各位大大一个问题  wxpython中的filedialog参数中的wildcard可以设置多个么。比如我要同时过滤出.txt和.log,txt file(*.txt)|*.txt|log file(*.log)|*.log这样设置的话,都是单独显示txt或者是log,而不是同时显示。有没有方法可以同时显示?Tkinter的话,貌似可以这样来设置('need files', '*.txt;*.log') ,不知道wxpython有没有类似的方法?



回复

使用道具 举报

1

主题

2

帖子

7

积分

贫民

积分
7
xiaogg0808  楼主| 发表于 2014-6-14 11:08:28 | 显示全部楼层
看了下官方文档    貌似是不支持。
http://wxpython.org/Phoenix/docs/html/FileDialog.html

All implementations of the FileDialog provide a wildcard filter. Typing a filename containing wildcards (, ?) in the filename text item, and clicking on Ok, will result in only those files matching the pattern being displayed. The wildcard may be a specification for multiple types of file with a description for each, such as:
wildcard = "BMP and GIF files (*.bmp*.gif)|*.bmp*.gif|PNG files (*.png)|*.png"
It must be noted that wildcard support in the native Motif file dialog is quite limited: only one file type is supported, and it is displayed without the descriptive test; “BMP files (.bmp)|.bmp” is displayed as “x.bmp”, and both “BMP files (.bmp)|.bmp|GIF files (.gif)|.gif” and “Image files|.bmp;.gif” are errors.
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表