Re: Programming the front end
- To: mathgroup at smc.vnet.net
- Subject: [mg20353] Re: Programming the front end
- From: "Dale Horton" <daleh at wolfram.com>
- Date: Sat, 16 Oct 1999 00:47:42 -0400
- Organization: Wolfram Research, Inc.
- References: <7tup8b$eie@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
How about. . . makeSection[] := Block[{}, NotebookWrite[EvaluationNotebook[], Cell["This is an object", "Subsubsection"]]; NotebookWrite[EvaluationNotebook[], Cell[BoxData[ RowBox[{RowBox[{RowBox[{"foo", "=", "bar"}], ";"}], " "}]], "Input"]]; NotebookWrite[EvaluationNotebook[], Cell[BoxData[ RowBox[{RowBox[{RowBox[{"foobar", "=", "barfoo"}], ";"}], " "}]], "Input"]]; NotebookWrite[EvaluationNotebook[], Cell[BoxData[ RowBox[{RowBox[{"test1", " ", "=", " ", "test2"}], ";"}]], "Input"]]; ]; Roberto Abraham <abraham at kodiak.demon.co.uk> wrote in message news:7tup8b$eie at smc.vnet.net... > Hi --- > > I'm new to front-end programming and am finding it a bit confusing. > Does anyone know how to program the front end to generate sections > containing cells that behave in the same manner as a section with a > bunch of cells created interactively? > > The makeSection[] function below generates a set of cells orgnized the > way I want but unfortunately the generated cells have funny properties in > terms of overwriting each other when I want them to, and not overwriting > each other when I do want them to! For example, evaluating this function > twice in a row doesn't create two subsubsections (the behaviour I'm > after), instead it creates a single subsubsection and appends the > cells from the second function call to the end of the first section. I've > experimented with adding the GeneratedCell->False option to various > cells but this doesn't seem to help. > > makeSection[] := Block[{}, > CellPrint[Cell["This is an object", "Subsubsection"]]; > lPrint[ > Cell[BoxData[ > RowBox[{RowBox[{RowBox[{"foo", "=", "bar"}], ";"}], " "}]], > "Input"]]; > CellPrint[ > Cell[BoxData[ > RowBox[{RowBox[{RowBox[{"foobar", "=", "barfoo"}], ";"}], " "}]], > "Input"]]; > CellPrint[ > Cell[BoxData[ > RowBox[{RowBox[{"test1", " ", "=", " ", "test2"}], ";"}]], > "Input"]]; > ]; > > The point of this exercise is to ultimately read in a set of image > file names from an ascii file generated outside of mathematica, and to > use something akin to this function to generate a bunch of labelled > sections in a notebook containing the commands needed to analyse and > reduce the images. > > Thanks, > > Bob Abraham > abraham at ast.cam.ac.uk > > ~ > ~ > ~ > > >