Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: pgplotmanager.setagent - Function Up: pgplotmanager - Tool Previous: pgplotps - Constructor


pgplotmanager.getagent - Function



Package display
Module plotter
Tool pgplotmanager


return the PGPLOT agent being managed by this tool


Synopsis
getagent()



Description
This function simply returns a reference to the PGPLOT agent currently being managed by this tool. This function is rarely needed in most applications; however, it does allow an application to temporarily pass the agent to another pgplotmanager in order, for example, playback its displaylist to the agent.

Care should be taken by the caller of this function, especially when the agent is attached to a graphical widget. Widgets are destroyed only when all references to its agent are eliminated. When this tool's done() function is called, the tool will eliminate its internal reference; however, the widget will not disappear if the caller of this function still has a reference. Note in the example below how the caller takes care to destroy its reference to the agent when it's done with it.



Returns
pgplot agent



Example
In this example, the pgplot agent is passed to another pgplotmanager tool. This is, admittedly, a somewhat contrived example.
# this will record commands for drawing a special plot
drawplot := pgplotmanager(record=T);
drawplot.env(0, 2 * pi, -1, 1, 0, 0);

# this will display the plot to the user
f := frame();
pgpm := pgplotmanager(pgplot(f));

# draw plot to widget
pgpa := pgpm.getagent();
drawplot.setagent(pgpa);
drawplot.refresh();
drawplot.setagent(close=F);  # reset agent to null, but don't close widget
pgpa := F;                   # Now pgpm has the only reference to the agent

# now continue plotting
pgpm.arro(1, -1, 5, -0.5)





next up previous contents index
Next: pgplotmanager.setagent - Function Up: pgplotmanager - Tool Previous: pgplotps - Constructor   Contents   Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc., Washington, D.C.

Return to AIPS++ Home Page
2006-10-15