File Chooser startup folder



If I have some kind of FileChooser widget I can use the 'set_filename()' function to preselect a file to 
appear when the widget gets opened.  So for example if, on a Windows system, I specified this:-

C:/Program Files/Hello/HelloWorld.txt

the widget would open in the folder "C:\Program Files\Hello" with the file "HelloWorld.txt" already selected.

But suppose I want the widget to open in a certain folder but without any file selected.  I assumed I'd be 
able to specify this:-

C:/Program Files/Hello

Unfortunately that doesn't work....  "Hello" is deemed to be a file name (not a folder name).  So what 
actually happens is that the widget opens in the parent folder (C:\Program Files) with no file selected.  
IIRC the same thing happens, even if I terminate with a folder separator (i.e. "C:/Program Files/Hello/")

The only way I've found around this is either to specify the name of a sub-folder or to specify a file name 
that's not likely to exist on the target system - e.g.

C:/Program Files/Hello/AbAbAb.XyZ

This does work but it seems rather kludgy to me.  Is there a more elegant solution?

John


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]