In article <c2**********@atlantis.news.tpi.pl>,
"Ringwraith" <at**@go2.pl> wrote:
I have the following problem. I use the tkFileDialog.askdirectory dialog to
allow users of my application to pick some subfolder from 'C:/my_app'
directory. I use initialdir='C:/my_app' option to set 'C:/my_app' as initial
directory. But I want my initial directory to be also a root directory, so
the user cannot pick any directory outside 'C:/my_app' folder. I have no
idea how to do it using standard tkFileDialog.askdirectory. Is that
possible?
Some possible solutions:
- Write your own version that does this, e.g. via bindings that detect
when the user tries to change directory and screens the requested
change. Unfortunately, from a quick look at tkFileDialog, I did not see
any easy way to adapt the existing code; unless I missed something you
may have to pretty much code from scratch.
- Allow the user to select anything, but then test it and reject it if
it doesn't meet your requirements. This is trivial to code, but a pain
for the user.
- See if you can redesign your code to eliminate the requirement.
-- Russell