FileDialog from Spec

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

FileDialog from Spec

Jeff Gray
In Pharo 4.
I'm writing a ui in spec and I want to be able to select and open a file on a button click.
I can see one example in polymorph but I don't know if that can be used from spec.
Or am I missing something obvious?
 
Reply | Threaded
Open this post in threaded view
|

Re: FileDialog from Spec

Nicolai Hess-3-2


2015-11-12 7:23 GMT+01:00 Jeff Gray <[hidden email]>:
In Pharo 4.
I'm writing a ui in spec and I want to be able to select and open a file on
a button click.
I can see one example in polymorph but I don't know if that can be used from
spec.
Or am I missing something obvious?

We don't have a spec based FileDialog (or FileChooserModel) yet.

Do you want to integrate the FileChooserUI in your spec based UI, or just
open a FileChooserDialog?

If you just want to open a dialog, I would say, take the polymorph one.
If you want to have the FileChooser as a part of your UI, you 'll have to
create a new spec model for it.


nicolai

 




--
View this message in context: http://forum.world.st/FileDialog-from-Spec-tp4860608.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: FileDialog from Spec

Jeff Gray
I just want to call a dialog on a button click.

What approach do I take with the Polymorph one?
Do I have to open a Polymorph window which then calls the dialog or can I bake the Polymorph dialog into my spec window?
Reply | Threaded
Open this post in threaded view
|

Re: FileDialog from Spec

Henrik Nergaard
Hi Jeff,
Here is an example to bring up the file dialog answering a file reference.

| reference |
reference := UIManager default
  fileSave: 'Save as?'
  extensions: #('pdf' 'png' 'stuff')
  path: Smalltalk imageDirectory.

For other examples see MorphicUIManager where methods start with file*

Best regards,
Henrik

-----Original Message-----
From: Pharo-users [mailto:[hidden email]] On Behalf Of Jeff Gray
Sent: Thursday, November 12, 2015 11:22 PM
To: [hidden email]
Subject: Re: [Pharo-users] FileDialog from Spec

I just want to call a dialog on a button click.

What approach do I take with the Polymorph one?
Do I have to open a Polymorph window which then calls the dialog or can I bake the Polymorph dialog into my spec window?



--
View this message in context: http://forum.world.st/FileDialog-from-Spec-tp4860608p4860782.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


Reply | Threaded
Open this post in threaded view
|

Re: FileDialog from Spec

Jeff Gray
Thanks! That worked like a charm.