[Pharo-project] file dialog
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? Cheers, Doru -- www.tudorgirba.com "Next time you see your life passing by, say 'hi' and get to know her."
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
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
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?"
Hi again, On the same topic, what is the invocation to open a dialogue that allows for saving files? Cheers, Doru On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com "Some battles are better lost than fought."
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc. For the moment your best bet is: UITheme builder fileSave: 'Your title here' which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others. Regards, Gary ----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog Hi again, On the same topic, what is the invocation to open a dialogue that allows for saving files? Cheers, Doru On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com "Some battles are better lost than fought." _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Thanks. Doru On 7 Aug 2009, at 11:25, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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 "It's not what we do that matters most, it's how we do it."
Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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
I'll add some then :-) Printing, unfortunately, is another common feature that is not really supported. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 3:18 PM Subject: Re: [Pharo-project] file dialog Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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
Gary, Some time ago, you mentioned having made some progress on printing. Is that something you can make available? Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Friday, August 07, 2009 9:24 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog I'll add some then :-) Printing, unfortunately, is another common feature that is not really supported. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 3:18 PM Subject: Re: [Pharo-project] file dialog Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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 _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
Nothing generic, just enough for us to get Postscript/PDF out to file for printing via lpr in Linux. Regards, Gary ----- Original Message ----- From: "Schwab,Wilhelm K" <bschwab@anest.ufl.edu> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 8:07 PM Subject: Re: [Pharo-project] file dialog Gary, Some time ago, you mentioned having made some progress on printing. Is that something you can make available? Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Friday, August 07, 2009 9:24 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog I'll add some then :-) Printing, unfortunately, is another common feature that is not really supported. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 3:18 PM Subject: Re: [Pharo-project] file dialog Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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 _______________________________________________ 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
Gary, Were you able to pipe the data to lpr, or did you find it necessary to write a file? The latter is not a disaster, but it's always nice to skip that step if possible. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Monday, August 10, 2009 10:41 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog Nothing generic, just enough for us to get Postscript/PDF out to file for printing via lpr in Linux. Regards, Gary ----- Original Message ----- From: "Schwab,Wilhelm K" <bschwab@anest.ufl.edu> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 8:07 PM Subject: Re: [Pharo-project] file dialog Gary, Some time ago, you mentioned having made some progress on printing. Is that something you can make available? Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Friday, August 07, 2009 9:24 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog I'll add some then :-) Printing, unfortunately, is another common feature that is not really supported. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 3:18 PM Subject: Re: [Pharo-project] file dialog Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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 _______________________________________________ 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
File write at present, not ideal... Allows checking for when the file is spooled amongst other things. Regards, Gary ----- Original Message ----- From: "Schwab,Wilhelm K" <bschwab@anest.ufl.edu> To: <Pharo-project@lists.gforge.inria.fr> Sent: Monday, August 10, 2009 6:13 PM Subject: Re: [Pharo-project] file dialog Gary, Were you able to pipe the data to lpr, or did you find it necessary to write a file? The latter is not a disaster, but it's always nice to skip that step if possible. Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Monday, August 10, 2009 10:41 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog Nothing generic, just enough for us to get Postscript/PDF out to file for printing via lpr in Linux. Regards, Gary ----- Original Message ----- From: "Schwab,Wilhelm K" <bschwab@anest.ufl.edu> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 8:07 PM Subject: Re: [Pharo-project] file dialog Gary, Some time ago, you mentioned having made some progress on printing. Is that something you can make available? Bill -----Original Message----- From: pharo-project-bounces@lists.gforge.inria.fr [mailto:pharo-project-bounces@lists.gforge.inria.fr] On Behalf Of Gary Chambers Sent: Friday, August 07, 2009 9:24 AM To: Pharo-project@lists.gforge.inria.fr Subject: Re: [Pharo-project] file dialog I'll add some then :-) Printing, unfortunately, is another common feature that is not really supported. Regards, Gary ----- Original Message ----- From: "Stéphane Ducasse" <stephane.ducasse@inria.fr> To: <Pharo-project@lists.gforge.inria.fr> Sent: Friday, August 07, 2009 3:18 PM Subject: Re: [Pharo-project] file dialog Yes and we would integrate fast any steps in that direction. Stef On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 10:36 AM Subject: Re: [Pharo-project] file dialog
Hi again,
On the same topic, what is the invocation to open a dialogue that allows for saving files?
Cheers, Doru
On 5 Aug 2009, at 10:26, Tudor Girba wrote:
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?"
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- www.tudorgirba.com
"Some battles are better lost than fought."
_______________________________________________ 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 _______________________________________________ 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 _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
In Sophie we built out the native file dialog handlers for Windows and macintosh. Someone might want to harvest them? People *like* working with the native platform file choosers/pickers. Extensive use of FFI tho, but a fall back to squeak like file dialogs if we found the platform didn't support the native ones. On 7-Aug-09, at 7:18 AM, Stéphane Ducasse wrote:
Yes and we would integrate fast any steps in that direction.
Stef
On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
-- = = = ======================================================================== John M. McIntosh <johnmci@smalltalkconsulting.com> Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http://www.smalltalkconsulting.com = = = ========================================================================
with the fallback solution you mentioned it would be great. Stef On Aug 8, 2009, at 3:19 AM, John M McIntosh wrote:
In Sophie we built out the native file dialog handlers for Windows and macintosh. Someone might want to harvest them?
People *like* working with the native platform file choosers/pickers.
Extensive use of FFI tho, but a fall back to squeak like file dialogs if we found the platform didn't support the native ones.
On 7-Aug-09, at 7:18 AM, Stéphane Ducasse wrote:
Yes and we would integrate fast any steps in that direction.
Stef
On Aug 7, 2009, at 11:25 AM, Gary Chambers wrote:
Unfortunately, the current protocol of UIManager is rather limited. Would be good to flesh out properly with colour choosers, font choosers etc.
For the moment your best bet is:
UITheme builder fileSave: 'Your title here'
which returns a new empty file stream or nil if cancelled. There are other variants, see TEasilyThemed for others.
Regards, Gary
-- = = = = = ====================================================================== John M. McIntosh <johnmci@smalltalkconsulting.com> Twitter: squeaker68882 Corporate Smalltalk Consulting Ltd. http:// www.smalltalkconsulting.com = = = = = ======================================================================
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
The fileNamePattern is the dynamic user filter (the text area under the tree). The extentsions list is designed to limit the file types under program control. Regards, Gary ----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: <Pharo-project@lists.gforge.inria.fr> Sent: Wednesday, August 05, 2009 9:26 AM Subject: Re: [Pharo-project] file dialog 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?" _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
The ui manager method is designed to be compatible with the pre-existing MorphicToollBuilder usage... You should write as such: UIManager default chooseFileMatching: #('mse') label: 'Import model from MSE file.'. It is unfortunate that the method name is somewhat misleading. Regards, Gary ----- Original Message ----- From: "Tudor Girba" <girba@iam.unibe.ch> To: "Pharo Development" <pharo-project@lists.gforge.inria.fr> Sent: Tuesday, August 04, 2009 11:32 PM Subject: [Pharo-project] file dialog
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?
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
participants (6)
-
Gary Chambers -
John M McIntosh -
Mariano Martinez Peck -
Schwab,Wilhelm K -
Stéphane Ducasse -
Tudor Girba