Class: Gtk::TextView
- Extended by:
- GLib::Deprecatable
- Defined in:
- lib/gtk4/text-view.rb,
lib/gtk4/deprecated.rb
Instance Method Summary collapse
-
#accepts_tab ⇒ Boolean
Returns whether pressing the Tab key inserts a tab characters.
-
#accepts_tab=(accepts_tab) ⇒ Boolean
Whether Tab will result in a tab character being entered.
-
#accepts_tab? ⇒ Boolean
Whether Tab will result in a tab character being entered.
-
#add_child_at_anchor(child, anchor) ⇒ nil
Adds a child widget in the text buffer, at the given anchor.
-
#add_overlay(child, xpos, ypos) ⇒ nil
Adds child at a fixed coordinate in the
GtkTextView's text window. -
#backward_display_line(iter) ⇒ Boolean
Moves the given iter backward by one display (wrapped) line.
-
#backward_display_line_start(iter) ⇒ Boolean
Moves the given iter backward to the next display line start.
-
#bottom_margin ⇒ Integer
The bottom margin for text in the text view.
-
#bottom_margin=(bottom_margin) ⇒ Integer
The bottom margin for text in the text view.
-
#buffer ⇒ Gtk::TextBuffer
The buffer which is displayed.
-
#buffer=(buffer) ⇒ Gtk::TextBuffer
The buffer which is displayed.
-
#buffer_to_window_coords(win, buffer_x, buffer_y, window_x, window_y) ⇒ nil
Converts buffer coordinates to window coordinates.
-
#cursor_visible ⇒ Boolean
Find out whether the cursor should be displayed.
-
#cursor_visible=(cursor_visible) ⇒ Boolean
If the insertion cursor is shown.
-
#cursor_visible? ⇒ Boolean
If the insertion cursor is shown.
-
#editable ⇒ Boolean
Returns the default editability of the
GtkTextView. - #editable=(editable) ⇒ Boolean
-
#editable? ⇒ Boolean
Editable.
-
#extra_menu ⇒ Gio::MenuModel
A menu model whose contents will be appended to the context menu.
-
#extra_menu=(extra_menu) ⇒ Gio::MenuModel
A menu model whose contents will be appended to the context menu.
-
#forward_display_line(iter) ⇒ Boolean
Moves the given iter forward by one display (wrapped) line.
-
#forward_display_line_end(iter) ⇒ Boolean
Moves the given iter forward to the next display line end.
-
#get_cursor_locations(iter, strong, weak) ⇒ nil
Determine the positions of the strong and weak cursors if the insertion point is at iter.
-
#get_gutter(win) ⇒ Gtk::Widget
Gets a
GtkWidgetthat has previously been set as gutter. - #get_iter_at(options) ⇒ Object
-
#get_iter_at_location(x, y) ⇒ Boolean
Retrieves the iterator at buffer coordinates x and y.
-
#get_iter_at_location_raw ⇒ Boolean
Retrieves the iterator at buffer coordinates x and y.
-
#get_iter_at_position(x, y) ⇒ Boolean
Retrieves the iterator pointing to the character at buffer coordinates x and y.
-
#get_iter_at_position_raw ⇒ Boolean
Retrieves the iterator pointing to the character at buffer coordinates x and y.
-
#get_iter_location(iter, location) ⇒ nil
Gets a rectangle which roughly contains the character at iter.
-
#get_line_at_y(target_iter, y, line_top) ⇒ nil
Gets the
GtkTextIterat the start of the line containing the coordinate y. -
#get_line_yrange(iter, y, height) ⇒ nil
Gets the y coordinate of the top of the line containing iter, and the height of the line.
-
#get_visible_rect(visible_rect) ⇒ nil
Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates.
-
#im_context_filter_keypress(event) ⇒ Boolean
Allow the
GtkTextViewinput method to internally handle key press and release events. -
#im_module ⇒ String
Which IM (input method) module should be used for this text_view.
-
#im_module=(im_module) ⇒ String
Which IM (input method) module should be used for this text_view.
-
#indent ⇒ Integer
Amount to indent the paragraph, in pixels.
-
#indent=(indent) ⇒ Integer
Amount to indent the paragraph, in pixels.
-
#initialize(buffer) ⇒ Gtk::Widget
constructor
Creates a new
GtkTextViewwidget displaying the buffer buffer. -
#input_hints ⇒ Gtk::InputHints
Additional hints (beyond [propertyGtk.TextView:input-purpose]) that allow input methods to fine-tune their behaviour.
-
#input_hints=(input_hints) ⇒ Gtk::InputHints
Additional hints (beyond [propertyGtk.TextView:input-purpose]) that allow input methods to fine-tune their behaviour.
-
#input_purpose ⇒ Gtk::InputPurpose
The purpose of this text field.
-
#input_purpose=(input_purpose) ⇒ Gtk::InputPurpose
The purpose of this text field.
-
#justification ⇒ Gtk::Justification
Justification.
- #justification=(justification) ⇒ Gtk::Justification
-
#left_margin ⇒ Integer
The default left margin for text in the text view.
-
#left_margin=(left_margin) ⇒ Integer
The default left margin for text in the text view.
-
#ltr_context ⇒ Pango::Context
Gets the
PangoContextthat is used for rendering LTR directed text layouts. -
#monospace ⇒ Boolean
Gets whether the
GtkTextViewuses monospace styling. -
#monospace=(monospace) ⇒ Boolean
Whether text should be displayed in a monospace font.
-
#monospace? ⇒ Boolean
Whether text should be displayed in a monospace font.
-
#move_mark_onscreen(mark) ⇒ Boolean
Moves a mark within the buffer so that it's located within the currently-visible text area.
-
#move_overlay(child, xpos, ypos) ⇒ nil
Updates the position of a child.
-
#move_visually(iter, count) ⇒ Boolean
Move the iterator a given number of characters visually, treating it as the strong cursor position.
-
#overwrite ⇒ Boolean
Returns whether the
GtkTextViewis in overwrite mode or not. -
#overwrite=(overwrite) ⇒ Boolean
Whether entered text overwrites existing contents.
-
#overwrite? ⇒ Boolean
Whether entered text overwrites existing contents.
-
#pixels_above_lines ⇒ Integer
Pixels-above-lines.
- #pixels_above_lines=(pixels_above_lines) ⇒ Integer
-
#pixels_below_lines ⇒ Integer
Pixels-below-lines.
- #pixels_below_lines=(pixels_below_lines) ⇒ Integer
-
#pixels_inside_wrap ⇒ Integer
Pixels-inside-wrap.
- #pixels_inside_wrap=(pixels_inside_wrap) ⇒ Integer
-
#place_cursor_onscreen ⇒ Boolean
Moves the cursor to the currently visible region of the buffer.
-
#remove(child) ⇒ nil
Removes a child widget from text_view.
-
#reset_cursor_blink ⇒ nil
Ensures that the cursor is shown.
-
#reset_im_context ⇒ nil
Reset the input method context of the text view if needed.
-
#right_margin ⇒ Integer
The default right margin for text in the text view.
-
#right_margin=(right_margin) ⇒ Integer
The default right margin for text in the text view.
-
#rtl_context ⇒ Pango::Context
Gets the
PangoContextthat is used for rendering RTL directed text layouts. -
#scroll_mark_onscreen(mark) ⇒ nil
Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
-
#scroll_to_iter(iter, within_margin, use_align, xalign, yalign) ⇒ Boolean
Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.
-
#scroll_to_mark(mark, within_margin, use_align, xalign, yalign) ⇒ nil
Scrolls text_view so that mark is on the screen in the position indicated by xalign and yalign.
-
#set_gutter(win, widget) ⇒ nil
Places widget into the gutter specified by win.
-
#starts_display_line(iter) ⇒ Boolean
Determines whether iter is at the start of a display line.
-
#tabs ⇒ Pango::TabArray
Tabs.
- #tabs=(tabs) ⇒ Pango::TabArray
-
#top_margin ⇒ Integer
The top margin for text in the text view.
-
#top_margin=(top_margin) ⇒ Integer
The top margin for text in the text view.
-
#window_to_buffer_coords(win, window_x, window_y, buffer_x, buffer_y) ⇒ nil
Converts coordinates on the window identified by win to buffer coordinates.
-
#wrap_mode ⇒ Gtk::WrapMode
Wrap-mode.
- #wrap_mode=(wrap_mode) ⇒ Gtk::WrapMode
Methods inherited from Widget
#accessible_role, #accessible_role=, #action_set_enabled, #activate, #activate_action, #activate_action_variant, #activate_default, #activate_signal, #activate_signal=, #activate_signal_from_name=, #add_binding, #add_binding_action, #add_binding_signal, #add_controller, #add_css_class, #add_mnemonic_label, #add_shortcut, #add_tick_callback, #allocate, #allocated_baseline, #allocated_height, #allocated_width, #baseline, #bind_template_callback_full, #bind_template_child, #bind_template_child_full, #can_focus, #can_focus=, #can_focus?, #can_target, #can_target=, #can_target?, #child_focus, #child_visible, #child_visible=, #children, #clipboard, #compute_bounds, #compute_expand, #compute_point, #compute_transform, #contains, #create_pango_context, #create_pango_layout, #css_classes, #css_classes=, #css_name, #css_name=, #cursor, #cursor=, #cursor_from_name=, default_direction, default_direction=, #direction, #direction=, #display, #dispose_template, #drag_check_threshold, #error_bell, #first_child, #focus_child, #focus_child=, #focus_on_click, #focus_on_click=, #focus_on_click?, #focusable, #focusable=, #focusable?, #font_map, #font_map=, #font_options, #font_options=, #frame_clock, #get_allocation, #get_ancestor, #get_color, #get_preferred_size, #get_size, #get_size_request, #get_template_child, #grab_focus, #halign, #halign=, #has_css_class, #has_default, #has_default=, #has_default?, #has_focus, #has_focus=, #has_focus?, #has_tooltip, #has_tooltip=, #has_tooltip?, #has_visible_focus, have_template?, #height, #height_request, #height_request=, #hexpand, #hexpand=, #hexpand?, #hexpand_set, #hexpand_set=, #hexpand_set?, #hide, #in_destruction, #init_template, #insert_action_group, #insert_action_group_raw, #insert_after, #insert_before, #install_action, #install_property_action, #is_ancestor, #is_drawable, #is_focus, #is_sensitive, #is_visible, #keynav_failed, #last_child, #layout_manager, #layout_manager=, #layout_manager_type, #layout_manager_type=, #list_mnemonic_labels, #map, #mapped, #margin_bottom, #margin_bottom=, #margin_end, #margin_end=, #margin_start, #margin_start=, #margin_top, #margin_top=, #measure, #mnemonic_activate, #name, #name=, #native, #next_sibling, #observe_children, #observe_controllers, #opacity, #opacity=, #overflow, #overflow=, #pango_context, #parent, #parent=, #pick, #prev_sibling, #primary_clipboard, #query_action, #queue_allocate, #queue_draw, #queue_resize, #realize, #realized, #receives_default, #receives_default=, #receives_default?, #remove_controller, #remove_css_class, #remove_mnemonic_label, #remove_tick_callback, #request_mode, #root, #root=, #scale_factor, #scale_factor=, #sensitive, #sensitive=, #sensitive?, #set_size_request, #set_size_request_raw, #set_state_flags, #set_template, #set_template_raw, #settings, #should_layout, #show, #size_allocate, #snapshot_child, #state_flags, #style_context, #style_context_raw, #template=, template_children, #template_from_resource=, #template_scope=, #tooltip_markup, #tooltip_markup=, #tooltip_text, #tooltip_text=, #translate_coordinates, #translate_coordinates_raw, #trigger_tooltip_query, #unmap, #unparent, #unrealize, #unset_state_flags, #valign, #valign=, #vexpand, #vexpand=, #vexpand?, #vexpand_set, #vexpand_set=, #vexpand_set?, #visible, #visible=, #visible?, #width, #width_request, #width_request=
Constructor Details
#initialize(buffer) ⇒ Gtk::Widget
Creates a new GtkTextView widget displaying the buffer buffer.
One buffer can be shared among many widgets. buffer may be nil to create a default buffer, in which case this function is equivalent to [ctorGtk.TextView.new]. The text view adds its own reference count to the buffer; it does not take over an existing reference.
Instance Method Details
#accepts_tab ⇒ Boolean
Returns whether pressing the Tab key inserts a tab characters.
See [methodGtk.TextView.set_accepts_tab].
#accepts_tab=(accepts_tab) ⇒ Boolean
Whether Tab will result in a tab character being entered.
#accepts_tab? ⇒ Boolean
Whether Tab will result in a tab character being entered.
#add_child_at_anchor(child, anchor) ⇒ nil
Adds a child widget in the text buffer, at the given anchor.
#add_overlay(child, xpos, ypos) ⇒ nil
Adds child at a fixed coordinate in the GtkTextView's text window.
The xpos and ypos must be in buffer coordinates (see [methodGtk.TextView.get_iter_location] to convert to buffer coordinates).
child will scroll with the text view.
If instead you want a widget that will not move with the
GtkTextView contents see GtkOverlay.
#backward_display_line(iter) ⇒ Boolean
Moves the given iter backward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view’s width; paragraphs are the same in all
views, since they depend on the contents of the GtkTextBuffer.
#backward_display_line_start(iter) ⇒ Boolean
Moves the given iter backward to the next display line start.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view’s width; paragraphs are the same in all
views, since they depend on the contents of the GtkTextBuffer.
#bottom_margin ⇒ Integer
The bottom margin for text in the text view.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with [propertyGtk.Widget:margin-bottom].
#bottom_margin=(bottom_margin) ⇒ Integer
The bottom margin for text in the text view.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with [propertyGtk.Widget:margin-bottom].
#buffer ⇒ Gtk::TextBuffer
The buffer which is displayed.
#buffer=(buffer) ⇒ Gtk::TextBuffer
The buffer which is displayed.
#buffer_to_window_coords(win, buffer_x, buffer_y, window_x, window_y) ⇒ nil
Converts buffer coordinates to window coordinates.
#cursor_visible ⇒ Boolean
Find out whether the cursor should be displayed.
#cursor_visible=(cursor_visible) ⇒ Boolean
If the insertion cursor is shown.
#cursor_visible? ⇒ Boolean
If the insertion cursor is shown.
#editable ⇒ Boolean
Returns the default editability of the GtkTextView.
Tags in the buffer may override this setting for some ranges of text.
#editable=(editable) ⇒ Boolean
#editable? ⇒ Boolean
Returns editable.
#extra_menu ⇒ Gio::MenuModel
A menu model whose contents will be appended to the context menu.
#extra_menu=(extra_menu) ⇒ Gio::MenuModel
A menu model whose contents will be appended to the context menu.
#forward_display_line(iter) ⇒ Boolean
Moves the given iter forward by one display (wrapped) line.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view’s width; paragraphs are the same in all
views, since they depend on the contents of the GtkTextBuffer.
#forward_display_line_end(iter) ⇒ Boolean
Moves the given iter forward to the next display line end.
A display line is different from a paragraph. Paragraphs are
separated by newlines or other paragraph separator characters.
Display lines are created by line-wrapping a paragraph. If
wrapping is turned off, display lines and paragraphs will be the
same. Display lines are divided differently for each view, since
they depend on the view’s width; paragraphs are the same in all
views, since they depend on the contents of the GtkTextBuffer.
#get_cursor_locations(iter, strong, weak) ⇒ nil
Determine the positions of the strong and weak cursors if the insertion point is at iter.
The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction of the paragraph are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the paragraph are inserted.
If iter is nil, the actual cursor position is used.
Note that if iter happens to be the actual cursor position, and there is currently an IM preedit sequence being entered, the returned locations will be adjusted to account for the preedit cursor’s offset within the preedit sequence.
The rectangle position is in buffer coordinates; use [methodGtk.TextView.buffer_to_window_coords] to convert these coordinates to coordinates for one of the windows in the text view.
#get_gutter(win) ⇒ Gtk::Widget
Gets a GtkWidget that has previously been set as gutter.
See [methodGtk.TextView.set_gutter].
win must be one of %GTK_TEXT_WINDOW_LEFT, %GTK_TEXT_WINDOW_RIGHT, %GTK_TEXT_WINDOW_TOP, or %GTK_TEXT_WINDOW_BOTTOM.
#get_iter_at(options) ⇒ Object
19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gtk4/text-view.rb', line 19 def get_iter_at() location = [:location] position = [:position] if location get_iter_at_location(*location) elsif position get_iter_at_position(*position) else = "must specify :location or :position: #{.inspect}" raise ArgumentError, end end |
#get_iter_at_location(x, y) ⇒ Boolean
Retrieves the iterator at buffer coordinates x and y.
Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with [methodGtk.TextView.window_to_buffer_coords].
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/gtk4/text-view.rb', line 34 def get_iter_at_location(x, y) result = get_iter_at_location_raw(x, y) if result.is_a?(Gtk::TextIter) # For GTK+ < 3.20 iter = result iter else found, iter = result if found iter else nil end end end |
#get_iter_at_location_raw ⇒ Boolean
Retrieves the iterator at buffer coordinates x and y.
Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with [methodGtk.TextView.window_to_buffer_coords].
|
|
# File 'lib/gtk4/text-view.rb', line 33
|
#get_iter_at_position(x, y) ⇒ Boolean
Retrieves the iterator pointing to the character at buffer coordinates x and y.
Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with [methodGtk.TextView.window_to_buffer_coords].
Note that this is different from [methodGtk.TextView.get_iter_at_location], which returns cursor locations, i.e. positions between characters.
50 51 52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/gtk4/text-view.rb', line 50 def get_iter_at_position(x, y) result = get_iter_at_position_raw(x, y) if result.size == 2 # For GTK+ < 3.20 result else found, iter, trailing = result if found [iter, trailing] else nil end end end |
#get_iter_at_position_raw ⇒ Boolean
Retrieves the iterator pointing to the character at buffer coordinates x and y.
Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with [methodGtk.TextView.window_to_buffer_coords].
Note that this is different from [methodGtk.TextView.get_iter_at_location], which returns cursor locations, i.e. positions between characters.
|
|
# File 'lib/gtk4/text-view.rb', line 49
|
#get_iter_location(iter, location) ⇒ nil
Gets a rectangle which roughly contains the character at iter.
The rectangle position is in buffer coordinates; use [methodGtk.TextView.buffer_to_window_coords] to convert these coordinates to coordinates for one of the windows in the text view.
#get_line_at_y(target_iter, y, line_top) ⇒ nil
Gets the GtkTextIter at the start of the line containing
the coordinate y.
y is in buffer coordinates, convert from window coordinates with [methodGtk.TextView.window_to_buffer_coords]. If non-nil, line_top will be filled with the coordinate of the top edge of the line.
#get_line_yrange(iter, y, height) ⇒ nil
Gets the y coordinate of the top of the line containing iter, and the height of the line.
The coordinate is a buffer coordinate; convert to window coordinates with [methodGtk.TextView.buffer_to_window_coords].
#get_visible_rect(visible_rect) ⇒ nil
Fills visible_rect with the currently-visible region of the buffer, in buffer coordinates.
Convert to window coordinates with [methodGtk.TextView.buffer_to_window_coords].
#im_context_filter_keypress(event) ⇒ Boolean
Allow the GtkTextView input method to internally handle key press
and release events.
If this function returns true, then no further processing should be done for this key event. See [methodGtk.IMContext.filter_keypress].
Note that you are expected to call this function from your handler
when overriding key event handling. This is needed in the case when
you need to insert your own key handling between the input method
and the default key event handling of the GtkTextView.
static gboolean
gtk_foo_bar_key_press_event (GtkWidget *widget,
GdkEvent *event)
{
guint keyval;
gdk_event_get_keyval ((GdkEvent*)event, &keyval);
if (keyval == GDK_KEY_Return || keyval == GDK_KEY_KP_Enter)
{
if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (widget), event))
return TRUE;
}
// Do some stuff
return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
}
#im_module ⇒ String
Which IM (input method) module should be used for this text_view.
See [classGtk.IMMulticontext].
Setting this to a non-nil value overrides the system-wide IM module setting. See the GtkSettings [propertyGtk.Settings:gtk-im-module] property.
#im_module=(im_module) ⇒ String
Which IM (input method) module should be used for this text_view.
See [classGtk.IMMulticontext].
Setting this to a non-nil value overrides the system-wide IM module setting. See the GtkSettings [propertyGtk.Settings:gtk-im-module] property.
#indent ⇒ Integer
Amount to indent the paragraph, in pixels.
A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
#indent=(indent) ⇒ Integer
Amount to indent the paragraph, in pixels.
A negative value of indent will produce a hanging indentation. That is, the first line will have the full width, and subsequent lines will be indented by the absolute value of indent.
#input_hints ⇒ Gtk::InputHints
Additional hints (beyond [propertyGtk.TextView:input-purpose]) that allow input methods to fine-tune their behaviour.
#input_hints=(input_hints) ⇒ Gtk::InputHints
Additional hints (beyond [propertyGtk.TextView:input-purpose]) that allow input methods to fine-tune their behaviour.
#input_purpose ⇒ Gtk::InputPurpose
The purpose of this text field.
This property can be used by on-screen keyboards and other input methods to adjust their behaviour.
#input_purpose=(input_purpose) ⇒ Gtk::InputPurpose
The purpose of this text field.
This property can be used by on-screen keyboards and other input methods to adjust their behaviour.
#justification ⇒ Gtk::Justification
Returns justification.
#justification=(justification) ⇒ Gtk::Justification
#left_margin ⇒ Integer
The default left margin for text in the text view.
Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
#left_margin=(left_margin) ⇒ Integer
The default left margin for text in the text view.
Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
#ltr_context ⇒ Pango::Context
Gets the PangoContext that is used for rendering LTR directed
text layouts.
The context may be replaced when CSS changes occur.
#monospace ⇒ Boolean
Gets whether the GtkTextView uses monospace styling.
#monospace=(monospace) ⇒ Boolean
Whether text should be displayed in a monospace font.
If true, set the .monospace style class on the text view to indicate that a monospace font is desired.
#monospace? ⇒ Boolean
Whether text should be displayed in a monospace font.
If true, set the .monospace style class on the text view to indicate that a monospace font is desired.
#move_mark_onscreen(mark) ⇒ Boolean
Moves a mark within the buffer so that it's located within the currently-visible text area.
#move_overlay(child, xpos, ypos) ⇒ nil
Updates the position of a child.
See [methodGtk.TextView.add_overlay].
#move_visually(iter, count) ⇒ Boolean
Move the iterator a given number of characters visually, treating it as the strong cursor position.
If count is positive, then the new strong cursor position will be count positions to the right of the old cursor position. If count is negative then the new strong cursor position will be count positions to the left of the old cursor position.
In the presence of bi-directional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.
#overwrite ⇒ Boolean
Returns whether the GtkTextView is in overwrite mode or not.
#overwrite=(overwrite) ⇒ Boolean
Whether entered text overwrites existing contents.
#overwrite? ⇒ Boolean
Whether entered text overwrites existing contents.
#pixels_above_lines ⇒ Integer
Returns pixels-above-lines.
#pixels_above_lines=(pixels_above_lines) ⇒ Integer
#pixels_below_lines ⇒ Integer
Returns pixels-below-lines.
#pixels_below_lines=(pixels_below_lines) ⇒ Integer
#pixels_inside_wrap ⇒ Integer
Returns pixels-inside-wrap.
#pixels_inside_wrap=(pixels_inside_wrap) ⇒ Integer
#place_cursor_onscreen ⇒ Boolean
Moves the cursor to the currently visible region of the buffer.
#remove(child) ⇒ nil
Removes a child widget from text_view.
#reset_cursor_blink ⇒ nil
Ensures that the cursor is shown.
This also resets the time that it will stay blinking (or visible, in case blinking is disabled).
This function should be called in response to user input (e.g. from derived classes that override the textview's event handlers).
#reset_im_context ⇒ nil
Reset the input method context of the text view if needed.
This can be necessary in the case where modifying the buffer would confuse on-going input method behavior.
#right_margin ⇒ Integer
The default right margin for text in the text view.
Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
#right_margin=(right_margin) ⇒ Integer
The default right margin for text in the text view.
Tags in the buffer may override the default.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
#rtl_context ⇒ Pango::Context
Gets the PangoContext that is used for rendering RTL directed
text layouts.
The context may be replaced when CSS changes occur.
#scroll_mark_onscreen(mark) ⇒ nil
Scrolls text_view the minimum distance such that mark is contained within the visible area of the widget.
#scroll_to_iter(iter, within_margin, use_align, xalign, yalign) ⇒ Boolean
Scrolls text_view so that iter is on the screen in the position indicated by xalign and yalign.
An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin.
Note that this function uses the currently-computed height of the lines in the text buffer. Line heights are computed in an idle handler; so this function may not have the desired effect if it’s called before the height computations. To avoid oddness, consider using [methodGtk.TextView.scroll_to_mark] which saves a point to be scrolled to after line validation.
#scroll_to_mark(mark, within_margin, use_align, xalign, yalign) ⇒ nil
Scrolls text_view so that mark is on the screen in the position indicated by xalign and yalign.
An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If use_align is false, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size within_margin.
#set_gutter(win, widget) ⇒ nil
Places widget into the gutter specified by win.
win must be one of %GTK_TEXT_WINDOW_LEFT, %GTK_TEXT_WINDOW_RIGHT, %GTK_TEXT_WINDOW_TOP, or %GTK_TEXT_WINDOW_BOTTOM.
#starts_display_line(iter) ⇒ Boolean
Determines whether iter is at the start of a display line.
See [methodGtk.TextView.forward_display_line] for an explanation of display lines vs. paragraphs.
#tabs ⇒ Pango::TabArray
Returns tabs.
#tabs=(tabs) ⇒ Pango::TabArray
#top_margin ⇒ Integer
The top margin for text in the text view.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with [propertyGtk.Widget:margin-top].
#top_margin=(top_margin) ⇒ Integer
The top margin for text in the text view.
Note that this property is confusingly named. In CSS terms, the value set here is padding, and it is applied in addition to the padding from the theme.
Don't confuse this property with [propertyGtk.Widget:margin-top].
#window_to_buffer_coords(win, window_x, window_y, buffer_x, buffer_y) ⇒ nil
Converts coordinates on the window identified by win to buffer coordinates.
#wrap_mode ⇒ Gtk::WrapMode
Returns wrap-mode.