opening an OS window from within Pharo, to present a file directory ?

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

opening an OS window from within Pharo, to present a file directory ?

Torsten Bergmann
>Is there behavior for doing this in Pharo ?
>"self openOSWindowOn: aFileDirectory "

Your question can mean two things:

1. You ask for a file/folder selection dialog where the user
   selects a file or folder and you get the name back into Pharo:

     If you want to use the built in functionality use Polymorphs
     "FileDialogWindow" by using the services in UITheme class.
     (see references to class FileDialogWindow. But thats not an
     OS window.

     If you want to open an OS ("native") file/folder selection
     dialog from Pharo then there is currently no platform
     independent solution.
     AFAIK until today there is no primitive to do that.
     Maybe because the OS-systems are not uniform here.

For Windows there is a plugin for the open/save dialog provided
by the Win32-API:

 http://kminami.fc2web.com/Squeak/Goodies/Win32FileDialogPlugin/index.html

*Side note: Pharo has the same situation as Java here. By default
            there is an own implementation FileDialogWindow/JFileChooser
            that does not feel like the native one.

Another interpretation of your question:

2. You ask for a way to open a native file explorer/browser window
   on a given file/directory just to show the contents using
   the native window:

   You can use FFI for that on Windows:

      Win32Shell new shellOpen: 'c:\'
     
   Since most browsers display the directory structure and files
   too you can use the external web browser package and a file URL
   (see ConfigurationOfExternalWebBrowser)

       ExternalWebBrowser openOnUrl: 'file://c:/temp'

Bye
Torsten




--
Neu: GMX De-Mail - Einfach wie E-Mail, sicher wie ein Brief!  
Jetzt De-Mail-Adresse reservieren: http://portal.gmx.net/de/go/demail