(************** Content-type: application/mathematica ************** CreatedBy='Mathematica 5.1' Mathematica-Compatible Notebook This notebook can be used with any Mathematica-compatible application, such as Mathematica, MathReader or Publicon. The data for the notebook starts with the line containing stars above. To get the notebook into a Mathematica-compatible application, do one of the following: * Save the data starting with the line of stars above into a file with a name ending in .nb, then open the file inside the application; * Copy the data starting with the line of stars above to the clipboard, then use the Paste menu command inside the application. Data for notebooks contains only printable 7-bit ASCII and can be sent directly in email or through ftp in text mode. Newlines can be CR, LF or CRLF (Unix, Macintosh or MS-DOS style). NOTE: If you modify the data for this notebook not in a Mathematica- compatible application, you must delete the line below containing the word CacheID, otherwise Mathematica-compatible applications may try to use invalid cache data. For more information on notebooks and Mathematica-compatible applications, contact Wolfram Research: web: http://www.wolfram.com email: info@wolfram.com phone: +1-217-398-0700 (U.S.) Notebook reader applications are available free of charge from Wolfram Research. *******************************************************************) (*CacheID: 232*) (*NotebookFileLineBreakTest NotebookFileLineBreakTest*) (*NotebookOptionsPosition[ 11999, 272]*) (*NotebookOutlinePosition[ 12823, 301]*) (* CellTagsIndexPosition[ 12779, 297]*) (*WindowFrame->Normal*) Notebook[{ Cell[CellGroupData[{ Cell["Text and the Internet", "Title", TextAlignment->Center, TextJustification->0], Cell[CellGroupData[{ Cell["Introduction", "Section"], Cell["\<\ This example demonstrates how to use the text editor super widget, and also \ how to transmit information over the internet. Using this program, you can \ send me some much-needed feedback about the Super Widget Package! Obviously, \ this program requires an internet connection to work. \ \>", "Text"], Cell["\<\ Note that the data is sent using the POST mechanism of the HTTP protocol. The \ program may easily be adapted for a variety of internet-related tasks.\ \>", "Text"], Cell[CellGroupData[{ Cell["Code", "Subsection"], Cell[BoxData[ RowBox[{ RowBox[{"Needs", "[", "\"\\"", "]"}], ";"}]], "Input", CellLabel->"In[1]:="], Cell[BoxData[ RowBox[{ RowBox[{ RowBox[{"Make\[Breve]Comments", "[", "]"}], ":=", RowBox[{"Module", "[", RowBox[{ RowBox[{"{", RowBox[{ "text\[Breve]to\[Breve]send", ",", "fr1", ",", "ans", ",", "reply"}], "}"}], ",", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Ensure", " ", "the", " ", "version", " ", "of", " ", "the", " ", "SWP", " ", "is", " ", "adequate"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{ RowBox[{"If", "[", RowBox[{ RowBox[{ RowBox[{"SuperWidgetVersion", "[", "]"}], "<", "2.30"}], ",", RowBox[{ RowBox[{"ShowMessageBox", "[", RowBox[{ "\"\\"", ",", "\"\\"", ",", RowBox[{"{", "\"\\"", "}"}]}], "]"}], ";", RowBox[{"Abort", "[", "]"}]}]}], "]"}], ";", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "Display", " ", "the", " ", "box", " ", "to", " ", "accept", " ", "the", " ", "comments"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"text\[Breve]to\[Breve]send", "=", "\"\<\>\""}], ";", "\[IndentingNewLine]", RowBox[{"ans", "=", RowBox[{"SuperGUIRunModal", "[", RowBox[{"SuperWidgetFrame", "[", RowBox[{"fr1", ",", RowBox[{"{", "\[IndentingNewLine]", RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Image\[Breve]File", "[", RowBox[{ RowBox[{ "SuperWidgetPackagePath", "[", "]"}], "<>", "\"\\""}], "]"}], ",", "\[IndentingNewLine]", RowBox[{ "\"\\"", "<>", "\[IndentingNewLine]", "\"\\"", "<>", "\[IndentingNewLine]", "\"\\"", "<>", "\[IndentingNewLine]", "\"\\""}]}], "}"}], ",", "\n", RowBox[{"SuperWidgetTextEditor", "[", RowBox[{"text\[Breve]to\[Breve]send", ",", RowBox[{ "Pixel\[Breve]Width", "\[Rule]", "800"}], ",", RowBox[{ "Pixel\[Breve]Height", "\[Rule]", "600"}]}], "]"}], ",", SubscriptBox["\[Paragraph]", "10"], ",", "\[IndentingNewLine]", RowBox[{"{", RowBox[{ SubscriptBox["\[Paragraph]", "0"], ",", RowBox[{"SuperWidgetButton", "[", RowBox[{ "Null", ",", "\"\\"", ",", "1"}], "]"}], ",", SubscriptBox["\[Paragraph]", "10"], ",", RowBox[{"SuperWidgetButton", "[", RowBox[{ "Null", ",", "\"\\"", ",", "2"}], "]"}], ",", SubscriptBox["\[Paragraph]", "0"]}], "}"}], ",", SubscriptBox["\[Paragraph]", "10"]}], "\[IndentingNewLine]", "}"}], ",", "\[IndentingNewLine]", RowBox[{ "Title", "->", "\"\\""}]}], "]"}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ RowBox[{ "If", " ", "the", " ", "user", " ", "pressed", " ", RowBox[{"the", " ", "'"}], "Send", " ", RowBox[{"comments", "'"}], " ", "button"}], ",", " ", RowBox[{ "then", " ", "post", " ", "them", " ", "over", " ", "the", " ", "internet"}]}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"ans", "\[Equal]", "1"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{"reply", "=", RowBox[{"HTTP\[Breve]Post", "[", RowBox[{ "\"\\"", ",", RowBox[{"{", RowBox[{"{", RowBox[{ "\"\\"", ",", "text\[Breve]to\[Breve]send"}], "}"}], "}"}]}], "]"}]}], ";", "\[IndentingNewLine]", "\[IndentingNewLine]", RowBox[{"(*", " ", RowBox[{ "At", " ", "this", " ", "point", " ", "we", " ", "either", " ", "have", " ", "$Failed", " ", "or", " ", "we", " ", "have", " ", "a", " ", "string", " ", "containing", " ", "a", " ", "message", " ", "from", " ", "the", " ", "server"}], " ", "*)"}], "\[IndentingNewLine]", RowBox[{"If", "[", RowBox[{ RowBox[{"reply", "===", "$Failed"}], ",", "\[IndentingNewLine]", RowBox[{"ShowMessageBox", "[", RowBox[{ "\"\\"", ",", "\"\\"", ",", RowBox[{"{", "\"\\"", "}"}]}], "]"}], ",", "\[IndentingNewLine]", RowBox[{ RowBox[{ RowBox[{"{", RowBox[{ RowBox[{"Image\[Breve]File", "[", RowBox[{ RowBox[{ "SuperWidgetPackagePath", "[", "]"}], "<>", "\"\\""}], "]"}], ",", SubscriptBox["\[Paragraph]", "10"], ",", RowBox[{"{", RowBox[{ SubscriptBox["\[Paragraph]", "0"], ",", SubscriptBox["\[Paragraph]", "10"], ",", "reply", ",", SubscriptBox["\[Paragraph]", "10"], ",", SubscriptBox["\[Paragraph]", "0"]}], "}"}], ",", SubscriptBox["\[Paragraph]", "10"], ",", RowBox[{"{", RowBox[{ SubscriptBox["\[Paragraph]", "0"], ",", RowBox[{"SuperWidgetButton", "[", RowBox[{ "Null", ",", "\"\\"", ",", "1"}], "]"}], "\[IndentingNewLine]", ",", SubscriptBox["\[Paragraph]", "0"]}], "}"}], ",", SubscriptBox["\[Paragraph]", "10"]}], "}"}], "//", "SuperGUIRunModal"}], ";"}]}], "\[IndentingNewLine]", "]"}]}]}], "\[IndentingNewLine]", "]"}], ";"}]}], "\[IndentingNewLine]", "]"}]}], ";"}]], "Input", CellLabel->"In[1]:="], Cell[BoxData[ RowBox[{ RowBox[{"Make\[Breve]Comments", "[", "]"}], ";"}]], "Input", CellLabel->"In[2]:="] }, Open ]], Cell[CellGroupData[{ Cell["Comments", "Subsection"], Cell["", "Text"] }, Open ]] }, Open ]] }, Open ]] }, FrontEndVersion->"5.1 for Microsoft Windows", ScreenRectangle->{{0, 1280}, {0, 967}}, AutoGeneratedPackage->Automatic, WindowToolbars->"EditBar", WindowSize->{994, 887}, WindowMargins->{{125, Automatic}, {-89, Automatic}}, Visible->True, ShowSelection->True, ShowCellLabel->False, Magnification->1.25, StyleDefinitions -> "HelpBrowser.nb" ] (******************************************************************* Cached data follows. If you edit this Notebook file directly, not using Mathematica, you must remove the line containing CacheID at the top of the file. The cache data will then be recreated when you save this file from within Mathematica. *******************************************************************) (*CellTagsOutline CellTagsIndex->{} *) (*CellTagsIndex CellTagsIndex->{} *) (*NotebookFileOutline Notebook[{ Cell[CellGroupData[{ Cell[1776, 53, 87, 2, 130, "Title"], Cell[CellGroupData[{ Cell[1888, 59, 31, 0, 80, "Section"], Cell[1922, 61, 312, 5, 48, "Text"], Cell[2237, 68, 174, 3, 29, "Text"], Cell[CellGroupData[{ Cell[2436, 75, 26, 0, 48, "Subsection"], Cell[2465, 77, 140, 4, 33, "Input"], Cell[2608, 83, 9145, 172, 810, "Input"], Cell[11756, 257, 117, 3, 33, "Input"] }, Open ]], Cell[CellGroupData[{ Cell[11910, 265, 30, 0, 48, "Subsection"], Cell[11943, 267, 16, 0, 29, "Text"] }, Open ]] }, Open ]] }, Open ]] } ] *) (******************************************************************* End of Mathematica Notebook file. *******************************************************************)