MathGroup Archive 2007

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

Search the Archive

StringInput Question

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83475] StringInput Question
  • From: Joe Sneed <jsneed at mines.edu>
  • Date: Wed, 21 Nov 2007 02:54:02 -0500 (EST)
  • Organization: Colorado School of Mines

The following is is a test for a button that prompts for inputting a 
string to be written to a notebook.

*Cell[BoxData[
ButtonBox["TEST",
Active->True,
BaseStyle->"Paste",
ButtonFunction:>
FrontEndExecute[{
content =
InputString["New Tag"];
nb = SelectedNotebook[];
NotebookWrite[nb,
Cell[content, "Text"]];
Clear[content];
Clear[nb]}],
Evaluator->
"Local"]], "Text",
FontFamily->"Arial",*
*FontWeight->"Bold"]*

Run in V6.01, when the dialog box for StringInput is closed without 
input, the string

$Canceled

is written to the selected notebook.

The desired behavior (which I think occurred in V5.01, though I have no 
easy way to check now) is that when the dialog box for StringInput is 
closed without input, nothing is written. How can this be obtained with 
V6.01?

Any help much appreciated.

Joe Sneed

-- 
Joe Sneed
Division of Liberal Arts and International Studies
Colorado School of Mines
Golden CO USA
mailto:jsneed at mines.edu
http://www.mines.edu/fs_home/jsneed/





  • Prev by Date: Re: Scalars Instead of Lists with One Element
  • Next by Date: simple Button code hangs dynamic evaluation: why?
  • Previous by thread: Re: ListAnimate and GIF format saving
  • Next by thread: Re: StringInput Question