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
.
Gtk.showall
— Methodshowall(w::Gtk.GtkWidget)
Recursively show a widget, and any child widgets (if the widget is a container).
This function overrides the visible
property in all widgets in the hierarchy. Widgets can be protected from showall
by setting the no_show_all
property on the object to true
.
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
(gtk_text_iter_forward_chars
):lines
(gtk_text_iter_forward_lines
):words
(gtk_text_iter_forward_word_ends
):word_cursor_positions
(gtk_text_iter_forward_cursor_positions
):sentences
(gtk_text_iter_forward_sentence_ends
):visible_words
(gtk_text_iter_forward_visible_word_ends
):visible_cursor_positions
(gtk_text_iter_forward_visible_cursor_positions
):visible_lines
(gtk_text_iter_forward_visible_lines
):line_ends
(gtk_text_iter_forward_visible_lines
)
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 :
:forward_line
(gtk_text_iter_forward_line
):backward_line
(gtk_text_iter_backward_line
):forward_to_line_end
(gtk_text_iter_forward_to_line_end
):backward_word_start
(gtk_text_iter_forward_word_end
):forward_word_end
(gtk_text_iter_backward_word_start
):backward_sentence_start
(gtk_text_iter_backward_sentence_start
):forward_sentence_end
(gtk_text_iter_forward_sentence_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.pause_eventloop
— MethodGtk.pause_eventloop(f; force = false)
Pauses the eventloop around a function. Restores the state of the eventloop after pausing. Respects whether Gtk.jl is configured to allow auto-stopping of the eventloop, unless force = true
.
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
.