Re: Palettes
- To: mathgroup at smc.vnet.net
- Subject: [mg9363] Re: Palettes
- From: Paul E Howland <PEHowland at dera.gov.uk>
- Date: Sat, 1 Nov 1997 03:33:50 -0500
- Organization: DERA (Malvern)
- Sender: owner-wri-mathgroup at wolfram.com
I found Allan Hayes response to Shashidar's question re. a palette to display filenames most instructive. However, I interpret Shashidar's problem slightly differently. I suspect he is after a palette implementation of the "File Selector" window, which is a somewhat more complex problem than the one Allan has addressed. Certainly for my own work, I would find it very useful to be able to call a function like: file = FileSelector[Filter->"*.dat",DefaultDirectory->"/data"] and then have a palette appear which had the functionality of the File Selector window available in all windowing systems. On selecting a file, the palette would close, and the function would return the filename. Taking Allan's example a little further, you could conceive of something along the lines of: c1 = Cell[BoxData[ButtonBox[ RowBox[{#}], ButtonFunction:>Get[#], ButtonEvaluator->Automatic, Active->True]& /@ (ToString[#]&/@FileNames[])], "Input"]; NotebookPut[Notebook[{c1}]]; which creates a new notebook, containing a single cell with a button for each file in the current directory. However, it does not address several items, including: 1. Recognising the difference between files and directories 2. Clicking on a directory to enter it, then displaying a new file list 3. Having a "move up" button 4. Having separate and scrollable regions in the window (eg. file names should scroll, other buttons shouldn't) Has anyone any ideas on how the File Selector idea could be properly implemented? It seems to be a useful thing to have. Paul Paul E Howland PhD MEng CEng MIEE Room BY209 Senior Scientist DERA (Malvern) Land Systems Sector St Andrews Road Defence Evaluation & Research Agency Malvern tel. +44-(0)1684-895767 Worcestershire fax. +44-(0)1684-896315 UK Email PEHowland at dera.gov.uk Web Site http://www.dera.gov.uk Official Disclaimer: The views expressed above are entirely those of the writer amd do not represent the views, policy or understanding of any other person or official body.