MathGroup Archive 2007

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

Search the Archive

Re: FileNameSetter button return state

  • To: mathgroup at smc.vnet.net
  • Subject: [mg84348] Re: FileNameSetter button return state
  • From: ragfield <ragfield at gmail.com>
  • Date: Thu, 20 Dec 2007 00:01:38 -0500 (EST)
  • References: <fk55rt$141$1@smc.vnet.net>

On Dec 17, 12:44 am, "Steve Luttrell"
<steve at _removemefirst_luttrell.org.uk> wrote:
> I want to use FileNameSetter to create a button which behaves in the
> expected way for implementing a Save As... functionality.
>
> So I did this
>
> FileNameSetter[Dynamic[filename], "Save",  Appearance -> "Save File..."]
>
> This is fine, except that I can't find any way to determine whether the "OK"
> or "Cancel" button is used to exit the file dialog box. It is not sufficient
> to determine if the value of filename changes, because if you leave filename
> unchanged and use the "OK" button to exit the dialog then this appears to be
> indistinguishable from using the "Cancel" button.

Try this instead:

Button["Save File\[Ellipsis]",
 filename := SystemDialogInput["FileSave"], Method -> "Queued"]

-Rob


  • Prev by Date: Re: Plot without a graph
  • Next by Date: Re: pattern
  • Previous by thread: Re: FileNameSetter button return state
  • Next by thread: Re: FileNameSetter button return state