Thanks Mariano, The following code works: UIManager default chooseFileMatching: #('mse') label: 'Import model from MSE file.'. The problem is indeed that you have to pass a valid set of extensions, so * is not allowed. Anyway, it works for the moment but perhaps it should be changed to: FileDialogWindow>>validExtensions: aList "Set the filter for the files to be those with the given extensions." aList notEmpty ifTrue: [self defaultExtension: aList first]. self fileSelectionBlock: [:de | de isDirectory ifTrue: [self showDirectoriesInFileList] ifFalse: [(self fileNamePattern match: de name) and: [ aList contains: [:each | each match: (FileDirectory extensionFor: de name asLowercase) ] ]]] On the other hand the fileNamePattern seems to already have the job of filtering, so I do not really understand why we need aList. Cheers, Doru On 5 Aug 2009, at 09:39, Stéphane Ducasse wrote:
if you have a fix tag it 1.0 ;)
Stef
On Aug 5, 2009, at 12:56 AM, Mariano Martinez Peck wrote:
On Tue, Aug 4, 2009 at 7:32 PM, Tudor Girba <girba@iam.unibe.ch> wrote: Hi,
I need to load a file from the disk.
I am invoking: UIManager default chooseFileMatching: '*.mse' label: 'Import model from MSE file.'.
The problem is that I do not see any files, even though I have files with .mse ending in the directory. Also, even if I pass '*.*' I still cannot see the files (only the directories).
Could anyone tell me what I am doing wrong?
I could reproduce it and debugging I noticed that
FileDialogWindow>>validExtensions: aList "Set the filter for the files to be those with the given extensions."
aList notEmpty ifTrue: [self defaultExtension: aList first]. self fileSelectionBlock: [:de | de isDirectory ifTrue: [self showDirectoriesInFileList] ifFalse: [(self fileNamePattern match: de name) and: [ aList includes: (FileDirectory extensionFor: de name asLowercase)]]]
I think there can be a problem with this method. Here, aList will be '*.*' and as you can imagine that string doesn't includes any of the extensions. Perhaps we can change that include for a match: or something like that. To see this, remove the line aList includes: (FileDirectory extensionFor: de name asLowercase
and you will see that now all the files are shown.
we should open a ticket but I don't know if this should be 1.0 tag
best,
Mariano
Cheers, Doru
-- www.tudorgirba.com
"Next time you see your life passing by, say 'hi' and get to know her."
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com "What is more important: To be happy, or to make happy?"