Documentation for pp_lib

Generated by IDLdoc

./

pp_gettoolid.pro


top source pp_gettoolid

result = pp_gettoolid( [id], tool=tool)

Returns a valid (if any) tool ID, from the supplied (if any) id. This is useful inside routines that operate on iTools or Graphics, that have an input ID, but want to revert to the current tool if that is not provided or not valid. Also useful to retrieve a tool ID from a Graphics full identifier (as from the getfullidentifier method).

Parameters

id in optional

The ID to try to use to retrieve the actual tool ID. If the provided ID is valid, it is returned. Otherwise, if it is a Graphics full identifier (as from the getfullidentifier method), the returned ID is the corresponding tool ID. If it is not valid, the current tool ID (if any) is returned.

Keywords

tool

Returns the tool object associated with that id.

Examples

Make a couple of tools and see their IDs:

p=plot(/test,identifier=p_identifier) print,p_identifier ;/TOOLS/GRAPHIC print,p.getfullidentifier() ;/TOOLS/GRAPHIC/WINDOW/VIEW_1/VISUALIZATION LAYER/DATA SPACE/PLOT print,pp_gettoolid(p.getfullidentifier()) ;/TOOLS/GRAPHIC iplot,identifier=ip_identifier print,ip_identifier ;/TOOLS/PLOT TOOL print,pp_gettoolid() ;/TOOLS/PLOT TOOL

Author information

Author:

Paulo Penteado (pp.penteado@gmail.com), Feb/2010

Statistics

Lines:
16 lines
McCabe complexity:
6

File attributes

Modification date: Thu Jan 31 16:29:45 2013
Lines: 56
Docformat: rst rst