API Reference
Public interface
Gtk.buffer
— Methodbuffer(iter::Union{Mutable{GtkTextIter}, GtkTextIter})
Returns the buffer associated with iter
.
Gtk.create_mark
— Methodcreate_mark(buffer::GtkTextBuffer, mark_name, it::TI, left_gravity::Bool)
create_mark(buffer::GtkTextBuffer, it::TI)
Impements gtk_text_buffer_create_mark
.
Gtk.place_cursor
— Methodplace_cursor(buffer::GtkTextBuffer, it::GtkTextIter)
place_cursor(buffer::GtkTextBuffer, pos::Int)
Place the cursor at indicated position.
Gtk.scroll_to
— Methodscroll_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
.
Gtk.search
— Functionsearch(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.
Gtk.select_range
— Methodselect_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
.
Gtk.selection_bounds
— Methodselection_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
.
Private methods
Gtk.GtkTextIter
— MethodGtkTextIter(text::GtkTextBuffer, char_offset::Integer)
Creates a GtkTextIter
with offset char_offset
(one-based index).
Base.skip
— Methodskip(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)
Base.skip
— Methodskip(iter::Mutable{GtkTextIter}, count::Integer)
Moves iter
count
characters. Returns a Bool indicating if the move was successful.
Base.skip
— Methodskip(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)
Gtk.backward_search
— Methodbackward_search(iter::Mutable{GtkTextIter},
str::AbstractString, start::Mutable{GtkTextIter},
stop::Mutable{GtkTextIter}, limit::Mutable{GtkTextIter}, flag::Int32)
Implements `gtk_text_iter_backward_search`.
Gtk.buffer_to_window_coords
— Functionbuffer_to_window_coords(view::GtkTextView, buffer_x::Integer, buffer_y::Integer, wintype::Integer = 0)
Implements gtk_text_view_buffer_to_window_coords
.
Gtk.char_offset
— Methodchar_offset(iter::Union{Mutable{GtkTextIter}, GtkTextIter})
Returns the offset of iter
(one-based index).
Gtk.enable_eventloop
— FunctionGtk.enable_eventloop(b::Bool = true)
Set whether Gtk's event loop is running.
Gtk.forward_search
— Methodforward_search(iter::Mutable{GtkTextIter},
str::AbstractString, start::Mutable{GtkTextIter},
stop::Mutable{GtkTextIter}, limit::Mutable{GtkTextIter}, flag::Int32)
Implements `gtk_text_iter_forward_search`.
Gtk.is_eventloop_running
— MethodGtk.is_eventloop_running()::Bool
Check whether Gtk's event loop is running.
Gtk.text_iter_at_position
— Methodtext_iter_at_position(view::GtkTextView, x::Integer, y::Integer)
Implements gtk_text_view_get_iter_at_position
.
Gtk.window_to_buffer_coords
— Functionwindow_to_buffer_coords(view::Gtk.GtkTextView, window_x::Integer, window_y::Integer, wintype::Integer = 2)
Implements gtk_text_view_window_to_buffer_coords
.