GtkSource.HoverContext

g GObject.Object GObject.Object GtkSource.HoverContext GtkSource.HoverContext GObject.Object->GtkSource.HoverContext

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

get_bounds ()

get_buffer ()

get_iter (iter)

get_view ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Fields

Inherited:

GObject.Object (1)

Class Details

class GtkSource.HoverContext(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

GtkSource.HoverContextClass

Context for populating [class`HoverDisplay`] contents.

GtkSourceHoverContext contains information about the request to populate contents for a [class`HoverDisplay`].

It can be used to retrieve the [class`View`], [class`Buffer`], and [struct`Gtk`.TextIter] for the regions of text which are being displayed.

Use [method`HoverContext`.get_bounds] to get the word that was requested. [method`HoverContext`.get_iter] will get you the location of the pointer when the request was made.

get_bounds()
Returns:

True if the marks are still valid and begin or end was set.

begin:

a Gtk.TextIter

end:

a Gtk.TextIter

Return type:

(bool, begin: Gtk.TextIter, end: Gtk.TextIter)

Gets the current word bounds of the hover.

If begin is non-None, it will be set to the start position of the current word being hovered.

If end is non-None, it will be set to the end position for the current word being hovered.

get_buffer()
Returns:

The GtkSource.Buffer for the view

Return type:

GtkSource.Buffer

A convenience function to get the buffer.

get_iter(iter)
Parameters:

iter (Gtk.TextIter) –

Return type:

bool

get_view()
Returns:

the GtkSource.View that owns the context

Return type:

GtkSource.View