Tepl.View

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.Scrollable Gtk.Scrollable GObject.GInterface->Gtk.Scrollable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gtk.Buildable->Gtk.Widget Gtk.Container Gtk.Container Gtk.TextView Gtk.TextView Gtk.Container->Gtk.TextView Gtk.Scrollable->Gtk.TextView GtkSource.View GtkSource.View Gtk.TextView->GtkSource.View Gtk.Widget->Gtk.Container Tepl.View Tepl.View GtkSource.View->Tepl.View

Subclasses:

None

Methods

Inherited:

GtkSource.View (36), Gtk.TextView (73), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Scrollable (9)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new ()

class

new_with_buffer (buffer)

copy_clipboard ()

cut_clipboard ()

delete_selection ()

goto_line (line)

goto_line_offset (line, line_offset)

paste_clipboard ()

scroll_to_cursor ()

select_all ()

select_lines (start_line, end_line)

Virtual Methods

Inherited:

GtkSource.View (6), Gtk.TextView (13), Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.Scrollable (1)

Properties

Inherited:

GtkSource.View (15), Gtk.TextView (21), Gtk.Container (3), Gtk.Widget (39), Gtk.Scrollable (4)

Style Properties

Inherited:

Gtk.TextView (1), Gtk.Widget (17)

Signals

Inherited:

GtkSource.View (11), Gtk.TextView (16), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Fields

Inherited:

GtkSource.View (11), Gtk.TextView (16), Gtk.Container (4), Gtk.Widget (69), GObject.Object (1)

Name

Type

Access

Description

parent_instance

GtkSource.View

r

Class Details

class Tepl.View(**kwargs)
Bases:

GtkSource.View

Abstract:

No

Structure:

Tepl.ViewClass

classmethod new()
Returns:

a new Tepl.View.

Return type:

Gtk.Widget

Creates a new Tepl.View.

By default, an empty Tepl.Buffer will be lazily created and can be retrieved with Gtk.TextView.get_buffer().

If you want to specify your own buffer, either override the Gtk.TextViewClass create_buffer factory method, or use Tepl.View.new_with_buffer().

New in version 1.0.

classmethod new_with_buffer(buffer)
Parameters:

buffer (GtkSource.Buffer) – a GtkSource.Buffer or a subclass of it.

Returns:

a new Tepl.View.

Return type:

Gtk.Widget

Creates a new Tepl.View widget displaying the buffer buffer.

New in version 5.0.

copy_clipboard()

Copies the clipboard.

New in version 1.0.

cut_clipboard()

Cuts the clipboard and then scrolls to the cursor position.

New in version 1.0.

delete_selection()

Deletes the text currently selected in the Gtk.TextBuffer associated to the view and then scrolls to the cursor position.

New in version 1.0.

goto_line(line)
Parameters:

line (int) – a line number, counting from 0.

Returns:

True if the cursor has been moved exactly to line, False if that line didn’t exist.

Return type:

bool

Places the cursor at the position returned by Gtk.TextBuffer.get_iter_at_line(), and scrolls to that position.

New in version 2.0.

goto_line_offset(line, line_offset)
Parameters:
  • line (int) – a line number, counting from 0.

  • line_offset (int) – the line offset, in characters (not bytes).

Returns:

True if the cursor has been moved exactly to line and line_offset, False if that position didn’t exist.

Return type:

bool

Places the cursor at the position returned by Gtk.TextBuffer.get_iter_at_line_offset(), and scrolls to that position.

New in version 2.0.

paste_clipboard()

Pastes the clipboard and then scrolls to the cursor position.

New in version 1.0.

scroll_to_cursor()

Scrolls the self to the cursor position.

New in version 1.0.

select_all()

Selects all the text.

New in version 1.0.

select_lines(start_line, end_line)
Parameters:
  • start_line (int) – start of the region to select.

  • end_line (int) – end of the region to select.

Selects the lines between start_line and end_line included, counting from zero. And then scrolls to the cursor.

Possible use-case: line numbers coming from a compilation output, to go to the place where a warning or error occurred.

New in version 2.0.