MathGroup Archive 2010

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: FileName Widget

  • To: mathgroup at smc.vnet.net
  • Subject: [mg114625] Re: FileName Widget
  • From: Patrick Scheibe <pscheibe at trm.uni-leipzig.de>
  • Date: Fri, 10 Dec 2010 02:32:43 -0500 (EST)

Hi,

when you use FileNameSetter, than the initial directory is determined by
the initial content of the variable. For instance this:

name = "/tmp";
FileNameSetter[Dynamic[name]]
Dynamic[name]

makes a "browse"-Button which starts browsing in the /tmp directory.

Hope this helps

Cheers
Patrick


On Thu, 2010-12-09 at 07:38 -0500, Kevin J. McCann wrote:
> Thanks for the tip. You should understand that I did look at the 
> documentation for FileNameSetter, which does not list this option.
> 
> Kevin
> 
> 
> On 12/9/2010 7:32 AM, Patrick Scheibe wrote:
> > Hi,
> >
> > I don't understand why don't you just have one look at the documentation
> > of the functions. You would have seen that it is simply something like
> >
> > SystemDialogInput["FileOpen", "/tmp"]
> >
> > or maybe
> >
> > SystemDialogInput["FileOpen", "C:\\"]
> >
> > when you're working on windoze.
> >
> > Cheers
> > Patrick
> >
> > On Thu, 2010-12-09 at 06:03 -0500, Kevin J. McCann wrote:
> >> Is there a way with FileNameSetter or the others to specify the initial
> >> search directory?
> >>
> >> Kevin
> >>
> >> On 12/8/2010 6:41 AM, John Fultz wrote:
> >>> And SystemDialogInput[] does return the file, not open it.  "FileOpen" refers to
> >>> the style of the file-picking dialog.  Open-style dialogs have different
> >>> properties than Save-style dialogs.  Open-style dialogs allow you to pick more
> >>> than one file and require you to choose existing files.  Save-style dialogs warn
> >>> you if you've targeted an existing file (which would potentially be
> >>> overwritten).  And there's some different labeling, too.
> >>>
> >>> As I believe somebody else already mentioned, FileNameSetter[] does this, too.
> >>> The difference between SystemDialogInput and FileNameSetter is that
> >>> FileNameSetter is intended to be used in a Dynamic interface for keeping a
> >>> Dynamic variable up to date (you can think of it as equivalent to the '...'
> >>> button you sometimes see next to an input field for setting filenames in some
> >>> dialog boxes), while SystemDialogInput requests the filename immediately and
> >>> stops execution of your input until the name is returned.  SystemDialogInput is
> >>> more appropriate for any procedural bit of code.
> >>>
> >>> Sincerely,
> >>>
> >>> John Fultz
> >>> jfultz at wolfram.com
> >>> User Interface Group
> >>> Wolfram Research, Inc.
> >>>
> >>>
> >>> On Tue, 7 Dec 2010 06:49:47 -0500 (EST), Murray Eisenberg wrote:
> >>>> The OP asked, I believe, for return of the file name, _not_ opening a
> >>>> file.
> >>>>
> >>>> On 12/5/2010 9:48 PM, Patrick Scheibe wrote:
> >>>>> Hi,
> >>>>>
> >>>>> what about
> >>>>>
> >>>>> SystemDialogInput["FileOpen"]
> >>>>>
> >>>>> ?
> >>>>>
> >>>>> Cheers
> >>>>> Patrick
> >>>>>
> >>>>> On Sat, 2010-12-04 at 06:13 -0500, leigh pascoe wrote:
> >>>>>> Has anybody written a widget to find and return file names. For
> >>>>>> example
> >>>>>> if I want to import an image or data file into mathematica, or assign
> >>>>>> a
> >>>>>> file name to a $Variable, it would be very convenient to have a
> >>>>>> function
> >>>>>> key that launched a windows style widget that permitted searching
> >>>>>> through directories (starting with My Computer or C:) and selecting
> >>>>>> the
> >>>>>> appropriate file. The full path of the selected file would then be
> >>>>>> inserted at the cursor.
> >>>>>>
> >>>>>> That seems such an obvious tool that it must exist already, but I
> >>>>>> haven't seen reference to one anywhere. Anybody?
> >>>>>>
> >>>>>> LP
> >>>
> >>>
> >
> >
> 



  • Prev by Date: Re: FileName Widget
  • Next by Date: Re: Replacement Rule with Sqrt in denominator. Also Bug in Series
  • Previous by thread: Re: FileName Widget
  • Next by thread: NMinimize vs NonlinearModelFit