MathGroup Archive 2002

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

Search the Archive

Automatic Closing of Animation Graphics Cells

  • To: mathgroup at smc.vnet.net
  • Subject: [mg37978] Automatic Closing of Animation Graphics Cells
  • From: "Dr. Robert Kragler" <kragler at fh-weingarten.de>
  • Date: Sat, 23 Nov 2002 19:14:57 -0500 (EST)
  • Organization: Rechenzentrum
  • Reply-to: kragler at fhwgt.de
  • Sender: owner-wri-mathgroup at wolfram.com

Hello, 

I am stuck with subsequent problem of FrontEnd programming. Perhaps, someone knows the 
solution. I would appreciate an answer :  

when a sequence of graphics cells for an animation is generated it would be favorable if all  
subsequent graphics cells would be grouped with respect to the top graphic cell (and not with  
respect to the preceding input cell evaluated). Then the graphics cells to be grouped should be 
closed  so that only the top level graphics cell is visible and animation is started with double-
clicking the top level graphics cell only. 

I found a partial solution which does the correct marking of the graphics cells being generated by  
a command such as  

     Animate[ Plot[ Sin[x t],  {x,-Pi,Pi} ], Frames -> 3 ]; 
     CloseAniSequenceTest 

where the following code for manipulating the notebook is used :  

 CloseAniSequenceTest := 
     Module[ { },  
                 SelectionMove[ EvaluationNotebook[ ], After, EvaluationCell ]; 
                 SelectionMove[ EvaluationNotebook[ ], Next, Cell ]; 
                 SelectionMove[ EvaluationNotebook[ ], Next, GeneratedCell ];  
                      ????? 
                 FrontEndTokenExecute["OpenCloseGroup"]  
               ] 
                 
But before using the final command FrontEndTokenExecute["OpenCloseGroup"]  there  
should be another command preceding that actually does the cell grouping wanted. The option 

                SetOption[ NotebookSelection[ ], CellGrouping -> Automatic ] 

does not perform the action I expected, and I could not find any hint in chapt. 2.10 of the  
Mathematica book for the solution.  

With the code above the graphics cells are marked correctly using the command 
CloseAniSequenceTest  but no  cell grouping as intended is done. 

Which additional Notebook command has to be inserted instead of "????".  I think only one 
additional line of code is required to do this but I cannot not find the right answer. 

Thanks in advance. 

Robert Kragler

---------------------------------------------------------------------
    Prof. Dr. Robert Kragler
    Fachhochschule Ravensburg-Weingarten
    University of Applied Sciences
    FB Physikalische Technik / Rechenzentrum    
    P.O.B 1241 ,  D-88241 Weingarten                             
    Germany
    Tel: +49 (751) 501-9603
    Fax: +49 (751) 501-5-9603
    E-Mail: kragler at rz.fh-weingarten.de 
    HomePage: http://www.fh-weingarten.de/
---------------------------------------------------------------------



  • Prev by Date: Re: Memory Problems and "shdw"
  • Next by Date: help with Export[...,"EPS"]
  • Previous by thread: Setting Options Back to Default Values? (and other graphics queries)
  • Next by thread: RE: Automatic Closing of Animation Graphics Cells