Re: OpenerView (with cells?)

*To*: mathgroup at smc.vnet.net*Subject*: [mg88130] Re: OpenerView (with cells?)*From*: Albert Retey <awnl at arcor.net>*Date*: Sat, 26 Apr 2008 03:41:18 -0400 (EDT)*References*: <fus8d0$82k$1@smc.vnet.net>

Hi, > 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. I don't think these are implemented with OpenerView but at a lower level with something like Opener, or even more likely at an even lower level which is probably not documented and not easy to access. Anyway, you can achieve the same behaviour with something like: CellPrint@Cell["tst", "Section", CellDingbat -> ToBoxes@DynamicModule[{state = False}, Opener[Dynamic[state, Function[ FrontEndExecute[{ FrontEnd`SelectionMove[FrontEnd`ButtonNotebook[], All, ButtonCell], FrontEndToken["OpenCloseGroup"] }]; state = # ] ]]] ] Of course you need to assure to create the right cell grouping if you don't want to rely on the automatic grouping of sections, subsections etc. On the other hand, when you create the correct grouping, you can just as well use the option ShowGroupOpener->True for the first cell to automatically get an opener with the correct behavior. hth, albert