Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Package | display | |
Module | plotter | |
Tool | pgplotmanager |
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.
# 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)