[Tkinter-discuss] tkinter file dialog pattern matching

Michael Lange klappnase at web.de
Sun Aug 23 13:11:00 CEST 2015


Hi,

On Sat, 22 Aug 2015 22:17:11 +0200
Laura Creighton <lac at openend.se> wrote:

> In a message of Sat, 22 Aug 2015 21:04:24 +0100, Pawel Mosakowski
> writes:
> >Hi,
> >
> >I've found this little gem in the Tk docs
> >https://www.tcl.tk/man/tcl8.4/TkCmd/getOpenFile.htm#M13
> >>From what I see "file patterns" in the file dialog are not "regex
> >patterns" and do not support special characters. Only things that work
> >are:
> >1) * - any extension
> >2) "" - files without extension
> >3) literal extension without wildcard chars
> >Unfortunately it looks like there is no simple way to filter out hidden
> >files.

if you only need to hide hidden files, please see my other post. If you
need a more versatile file dialog widget, you might want to consider
wrapping an existing tcl widget for tkinter, this is usually rather easy
once you understand how it is done (all you need is mostly the man page
and a little time) and might save you a lot of headaches.
One example that might be interisting is here:

http://chiselapp.com/user/schelte/repository/fsdialog/index

You might also want to try the Tix.ExFileSelectDialog, it is rather
dated, but actually has a switch to toggle hidden files on/off and
wildcard filtering capabilities. Unfortunately here with debian jessie I
can only test it with Tcl, with python for some reason I get a
segfault :-(

Best regards

Michael


.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

I realize that command does have its fascination, even under
circumstances such as these, but I neither enjoy the idea of command
nor am I frightened of it.  It simply exists, and I will do whatever
logically needs to be done.
		-- Spock, "The Galileo Seven", stardate 2812.7


More information about the Tkinter-discuss mailing list