API Reference

Public interface

Gtk.bufferMethod
buffer(iter::Union{Mutable{GtkTextIter}, GtkTextIter})

Returns the buffer associated with iter.

source
Gtk.create_markMethod
create_mark(buffer::GtkTextBuffer, mark_name, it::TI, left_gravity::Bool)
create_mark(buffer::GtkTextBuffer, it::TI)

Impements gtk_text_buffer_create_mark.

source
Gtk.place_cursorMethod
place_cursor(buffer::GtkTextBuffer, it::GtkTextIter)
place_cursor(buffer::GtkTextBuffer, pos::Int)

Place the cursor at indicated position.

source
Gtk.scroll_toMethod
scroll_to(view::GtkTextView, mark::GtkTextMark, within_margin::Real,
               use_align::Bool, xalign::Real, yalign::Real)

scroll_to(view::GtkTextView, iter::TI, within_margin::Real,
          use_align::Bool, xalign::Real, yalign::Real)

Implements gtk_text_view_scroll_to_mark and gtk_text_view_scroll_to_iter.

source
Gtk.searchFunction
search(buffer::GtkTextBuffer, str::AbstractString, direction = :forward,
    flag = GtkTextSearchFlags.GTK_TEXT_SEARCH_TEXT_ONLY)

Search text str in buffer in direction :forward or :backward starting from the cursor position in the buffer.

Returns a tuple (found, start, stop) where found indicates whether the search was successful and start and stop are GtkTextIters containing the location of the match.

source
Gtk.select_rangeMethod
select_range(buffer::GtkTextBuffer, ins::TI, bound::TI)
select_range(buffer::GtkTextBuffer, range::GtkTextRange)

Select the text in buffer accorind to GtkTextIter ins and bound.

Implements gtk_text_buffer_select_range.

source
Gtk.selection_boundsMethod
selection_bounds(buffer::GtkTextBuffer)

Returns a tuple (selected, start, stop) indicating if text is selected in the buffer, and if so sets the GtkTextIter start and stop to point to the selected text.

Implements gtk_text_buffer_get_selection_bounds.

source

Private methods

Gtk.GtkTextIterMethod
GtkTextIter(text::GtkTextBuffer, char_offset::Integer)

Creates a GtkTextIter with offset char_offset (one-based index).

source
Base.skipMethod
skip(iter::Mutable{GtkTextIter}, count::Integer, what::Symbol)

Moves iter according to the operation specified by what and count. Operations are :

  • :chars (gtktextiterforwardchars)
  • :lines (gtktextiterforwardlines)
  • :words (gtktextiterforwardword_ends)
  • :wordcursorpositions (gtktextiterforwardcursor_positions)
  • :sentences (gtktextiterforwardsentence_ends)
  • :visiblewords (gtktextiterforwardvisibleword_ends)
  • :visiblecursorpositions (gtktextiterforwardvisiblecursorpositions)
  • :visiblelines (gtktextiterforwardvisiblelines)
  • :lineends (gtktextiterforwardvisiblelines)
source
Base.skipMethod
skip(iter::Mutable{GtkTextIter}, count::Integer)

Moves iter count characters. Returns a Bool indicating if the move was successful.

source
Base.skipMethod
skip(iter::Mutable{GtkTextIter}, what::Symbol)

Moves iter according to the operation specified by what. Operations are :

  • :forwardline (gtktextiterforward_line)
  • :backwardline (gtktextiterbackward_line)
  • :forwardtolineend (gtktextiterforwardtoline_end)
  • :backwardwordstart (gtktextiterforwardword_end)
  • :forwardwordend (gtktextiterbackwardword_start)
  • :backwardsentencestart (gtktextiterbackwardsentence_start)
  • :forwardsentenceend (gtktextiterforwardsentence_end)
source
Gtk.backward_searchMethod
backward_search(iter::Mutable{GtkTextIter},
    str::AbstractString, start::Mutable{GtkTextIter},
    stop::Mutable{GtkTextIter}, limit::Mutable{GtkTextIter}, flag::Int32)

Implements `gtk_text_iter_backward_search`.
source
Gtk.buffer_to_window_coordsFunction
buffer_to_window_coords(view::GtkTextView, buffer_x::Integer, buffer_y::Integer, wintype::Integer = 0)

Implements gtk_text_view_buffer_to_window_coords.

source
Gtk.char_offsetMethod
char_offset(iter::Union{Mutable{GtkTextIter}, GtkTextIter})

Returns the offset of iter (one-based index).

source
Gtk.forward_searchMethod
forward_search(iter::Mutable{GtkTextIter},
    str::AbstractString, start::Mutable{GtkTextIter},
    stop::Mutable{GtkTextIter}, limit::Mutable{GtkTextIter}, flag::Int32)

Implements `gtk_text_iter_forward_search`.
source
Gtk.window_to_buffer_coordsFunction
window_to_buffer_coords(view::Gtk.GtkTextView, window_x::Integer, window_y::Integer, wintype::Integer = 2)

Implements gtk_text_view_window_to_buffer_coords.

source