Re: button to load files from a window
- To: mathgroup at smc.vnet.net
- Subject: [mg85424] Re: button to load files from a window
- From: "Steve Luttrell" <steve at _removemefirst_luttrell.org.uk>
- Date: Sun, 10 Feb 2008 05:14:43 -0500 (EST)
- References: <fojr1e$ger$1@smc.vnet.net>
Based on various responses that I got to my question "FileNameSetter button return state" on this newsgroup on 16th December 2007, here is a code fragment that I wrote which does what you want: filename = "*.*"; Button["Load...", If[# =!= $Canceled, filename = #;] &[ SystemDialogInput["FileOpen", filename, WindowTitle -> "Load..."]], Method -> "Queued"] Stephen Luttrell West Malvern, UK "Russo, Peter (10170)" <peter.russo at protiviti.com> wrote in message news:fojr1e$ger$1 at smc.vnet.net... >I am trying to make a button to load a file but that allows you to use a > window to browse through the directory tree ( like a C# winform or when > the window that pops up when go File->Open in the Mathematica front end > ) and click on a file. So, I suppose the button should contain the > command "ToFileName[]" as the command to load the file. However, is > there a command for a browser window or is there a way to construct one > =3F > > > > > > Peter > > > > > --------------------------------------------------------------------------- > --- > NOTICE: Protiviti is a leading international provider of independent > internal audit and business and technology risk consulting services. = > Protiviti is not licensed or registered as a public accounting firm and > does= > not issue opinions on financial statements or offer attestation services. > > > This electronic mail message is intended exclusively for the individual or > entity to which it is addressed. This message, together with any > attachment , may contain confidential and privileged information. Any > views, opinions or conclusions expressed in this message are those of the > individual sender and do not necessarily reflect the views of Protiviti > Inc. or its affiliates. Any unauthorized review, use, printing, copying, > retention, > disclosure or distribution is strictly prohibited. If you have received > this message in error, please immediately advise the sender by reply email > message to the sender and delete all copies of this message. Thank you. > =====================================================================