Re: OpenerView (with cells?)
- To: mathgroup at smc.vnet.net
- Subject: [mg88155] Re: OpenerView (with cells?)
- From: "David Park" <djmpark at comcast.net>
- Date: Sat, 26 Apr 2008 03:45:50 -0400 (EDT)
- References: <fus8d0$82k$1@smc.vnet.net>
Put a regular Sectional header in your notebook. Use Ctrl-Shift-E to open up the underlying expression. Then add to the cell the option ShowGroupOpenCloseIcon->True. Then, as soon as you have another cell in the section the little triangle will show and you can use it to open and close the section. These open/close icons are a very nice thing to have and I don't understand why they are not present on any of the standard style sheets. This may seem like a small thing but some people don't know about the double-clicking on the brackets, and other people just don't like it. I have a style sheet at my web site that does have these icons on all sectional groupings - but not on anything else. This is similar to the style sheet that comes with Presentations. This brings up a related question. It would be nice to have some kind of 'BoxSection' that could contain Text cells and Input/Output cells, but which other sections could 'flow around' just like boxes in textbooks or sidebars in magazine articles. Right now, if you try to use a subsection, close it up, and then enter a Text cell after it, the Text cell gets captured by the subsection. You can descend in the sectional hierarchy, but you can't get back up without actually starting a new higher level section. You can't 'flow around'. It is probably not easy for WRI to implement this. Right now for Presentations I've developed (but haven't included yet) something called Sidebars that solves this problem. The idea is to have Sidebar notebooks that are completely contained within a principal notebook but display as separate notebook windows. One first uses a MakeSidebar command to bring up a notebook window with a specified name. One can then add any desired information to the sidebar notebooks or change its style sheet just as with an ordinary notebook. But the sidebar notebook is not savable in the usual manner. Instead, in the principal notebook you can use a SaveSidebar command. This creates an initialization Input statement in the principal notebook that contains the sidebar notebook, but in skeleton form of display. The Sidebars are completely embedded in the principal notebook. Then there is a SidebarButton command that creates a distinctive button that will launch the Sidebar notebook. A reader can then bring up the Sidebars, read them, evaluate them and even do their own calculations in them, and then close them when finished. Sidebars are a very effective method to provide additional information without disrupting the flow of some argument, derivation or proof in a notebook. -- David Park djmpark at comcast.net http://home.comcast.net/~djmpark/ "J. McKenzie Alexander" <jalex at lse.ac.uk> wrote in message news:fus8d0$82k$1 at smc.vnet.net... > In the Mathematica documentation viewer, it looks as though sections > and subsection headers are implemented using an OpenerView that can > contain cells. At least when you click on the disclosure triangle next > to sections like "Examples", "More Information", "Options", and so on, > the view reveals a number of input, output, and text cells. > > How are those section headers implemented? An ordinary OpenerView, as > far as I can tell, cannot contain cells (although you can fake it a > little bit using DisplayForm). I looked at the cell expression for > one using Show Expression but what I found was just a reference to a > stylesheet: > > Cell[TextData[{ > "Basic Examples", > " ", > Cell["(4)", "ExampleCount"] > }], "ExampleSection", > CellID->454094506] > > Any ideas on how that effect is achieved? I'd like to use something > similar in my own notebooks. > > Many thanks, > > Jason > > -- > Dr. J. McKenzie Alexander > Department of Philosophy, Logic and Scientific Method > London School of Economics and Political Science > Houghton Street, London, WC2A 2AE >
- Follow-Ups:
- Re: Re: OpenerView (with cells?)
- From: "Thomas Dowling" <thomasgdowling@gmail.com>
- Re: Re: OpenerView (with cells?)