Element: entity.ebrowse

Type

callback

Description

The callback method for simple entities, invoked when entity browsing is active in a graphic window.

Entity browsing is a facility which displays descriptive tooltips as the mouse passes over entities within a graphic window. Whenever the mouse passes over an entity, the .ebrowse callback is invoked, which sets the tooltip text and the tooltip is then displayed. Browsing is activated by setting the window.browsing attribute of the appropriate graphic window.

The .ebrowse callback(s) must be defined for tooltips to be displayed. These callbacks are defined at a class level, rather than on individual entities and may be defined for gstructure classes, compound classes or just the generic entity class, i.e. entity.ebrowse.

The entity being passed over, and a glabel entity is passed to the callback, wherein the tooltip position, symbology, textstyle and text may be set. If no text is set, then no tooltip is displayed.

Once the callback has been executed, the tooltip glabel gets displayed (if it contains valid text). The window's overlay group (window.overlay) is used for the tooltip display. This is done behind the scenes.

During browsing, the system does the equivalent of an epick on the window and only invokes the .ebrowse callback if the entity is not filtered out during the pick (see window.pick_group, window.pick_filter etc.)

The standard entity.ebrowse method is only invoked for simple entities. It is not invoked for gstructures or compounds, which must have .ebrowse class callbacks of their own. If a class (gstructure or compound) has no .ebrowse callback defined, then no tooltip is shown during browsing.

Example

The following simple example will display the name of whichever entity is passed over as the mouse gets dragged about.

entity.ebrowse = {
# Define what the tooltip is when the mouse passes an entity
   args me=epointer, tt=epointer, gw=window
   tt.text = me.name
}
 
# Turn browing on for the graphic window
mywin.browsing = on

As can be seen, 3 parameters are passed to a .ebrowse method.
   me    the entity which the mouse is passing over,
   tt    a glabel entity with details of the tooltip,
   gw    the window in which all this is happening,
Both me and tt are passed as epointers.

Note: This callback will not be invoked for gstructures or compounds, for which .ebrowse class callbacks must be defined.

See Also

Callbacks:

compound.ebrowse, gstructure.ebrowse, window.browsing