Element: graphic_window.browsing

Type

numeric

Description

The state of entity browsing in graphic_window.

This element has a value of 1 or 2 when entity browsing is active, and 0 when it is not.

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

The .ebrowse callback(s) must be defined for tooltips to be displayed. These callbacks are defined at an entity 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, are 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.

The different on values (1 or 2) for window.browsing are used in conjunction with the window.exec callback which can be used display a popup menu in the window when the mouse is clicked. Typically an application would want to have a context popup menu available for when the mouse is over an entity for which the operator requires information. In this situation it is likely that when the mouse is not over an entity, no context menu would be required. A window.browsing value of 2 can be used for this, and directs the system to display a popup menu on mouse click only when a browse entity tooltip is being shown. A window.browsing value of 1 will invoke a popup menu on mouse click irrespective of whether or not a browse tooltip is being shown.

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 = 1

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, entity.ebrowse, gstructure.ebrowse, window.exec

Structures:

window.ebrowsed, window.exec_button