Indicators

Indicators style settings

Indicators are used to display additional information over the top of styling. They can be used to show, for example, syntax errors, deprecated names and bad indentation by drawing underlines under text or boxes around text. Originally, Scintilla stored indicator information in the style bytes but this has proved limiting, so now up to 32 separately stored indicators may be used.

Indicators may be displayed as simple underlines, squiggly underlines, a line of small ‘T’ shapes, a line of diagonal hatching, a strike-out or a rectangle around the text.

The gtkscintilla.Scintilla.indicator_set_style() method allow you to get and set the visual appearance of the indicators. They all use an indicatorNumber argument in the range 0 to INDIC_MAX(31) to set the indicator to style. To prevent interference the set of indicators is divided up into a range for use by lexers (0..7) and a range for use by containers (8=INDIC_CONTAINER .. 31=INDIC_MAX).

gtkscintilla.Scintilla.indicator_set_style(indic, [setting=None | **props )

This method set the style properties of indicators. You can pass an instance of gtkscintilla.IndicatorStyle or keyword arguments:

Parameters:
  • color – Foreground color of indicator
  • type – Indicator type, see below for further infos.
  • alpha – The translucency level of INDIC_ROUNDBOX (0-255)
  • under – The indicator should be under or over the text?
gtkscintilla.Scintilla.indicator_get_style(indic)
This returns an instance of gtkscintilal.IndicatorStyle, representing the style of the text.

The type parameter

Symbol Value Visual effect
INDIC_PLAIN 0 Underlined with a single, straight line.
INDIC_SQUIGGLE 1 A squiggly underline.
INDIC_TT 2 A line of small T shapes.
INDIC_DIAGONAL 3 Diagonal hatching.
INDIC_STRIKE 4 Strike out.
INDIC_HIDDEN 5 An indicator with no visual effect.
INDIC_BOX 6 A rectangle around the text.
INDIC_ROUNDBOX 7 A rectangle with rounded corners around the text using translucent drawing with the interior more transparent than the border. The default alpha value is 30.

The default indicator styles are equivalent to:

>>> s.indicator_set_style(0,type=INDIC_SQUIGGLE)
>>> s.indicator_set_style(1,type=INDIC_TT)
>>> s.indicator_set_style(2, INDIC_PLAIN)

Getting and retrieving indicators

gtkscintilla.Scintilla.set_indicator_current(indicator)
gtkscintilla.Scintilla.set_indicator_current()
These two methods set and get the indicator that will be affected by calls to indicator_fill_range() and indicator_clear_range().
gtkscintilla.Scintilla.set_indicator_value(value)
gtkscintilla.Scintilla.get_indicator_value()
These two messages set and get the value that will be set by calls to indicator_fill_range().
gtkscintilla.Scintilla.indicator_fill_range(position, fillLength)
gtkscintilla.Scintilla.indicator_clear_range(position, clearLength)
These two messages fill or clear a range for the current indicator. indicator_fill_range() fills with the the current value.
gtkscintilla.Scintilla.indicator_all_on_for(position)
Retrieve a bitmap value representing which indicators are non-zero at a position.
gtkscintilla.Scintilla.indicator_value_at(indicator, position)
Retrieve the value of a particular indicator at a position.
gtkscintilla.Scintilla.indicator_start(indicator, position)
gtkscintilla.Scintilla.indicator_end(indicator, position)
Find the start or end of a range with one value from a position within the range. Can be used to iterate through the document to discover all the indicator positions.

Table Of Contents

Previous topic

Markers

Next topic

Call tips

This Page