class Gtk::TextTag

Overview

A tag that can be applied to text contained in a Gtk::TextBuffer.

You may wish to begin by reading the text widget conceptual overview, which gives an overview of all the objects and data types related to the text widget and how they work together.

Tags should be in the Gtk::TextTagTable for a given Gtk::TextBuffer before using them with that buffer.

Gtk::TextBuffer#create_tag is the best way to create tags. See “gtk4-demo” for numerous examples.

For each property of Gtk::TextTag, there is a “set” property, e.g. “font-set” corresponds to “font”. These “set” properties reflect whether a property has been set or not.

They are maintained by GTK and you should not set them independently.

Defined in:

lib/gi-crystal/src/auto/gtk-4.0/text_tag.cr

Constructors

Class Method Summary

Instance Method Summary

Instance methods inherited from class GObject::Object

==(other : self) ==, bind_property(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags) : GObject::Binding bind_property, bind_property_full(source_property : String, target : GObject::Object, target_property : String, flags : GObject::BindingFlags, transform_to : GObject::Closure, transform_from : GObject::Closure) : GObject::Binding bind_property_full, data(key : String) : Pointer(Void) | Nil data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, hash(hasher) hash, notify(property_name : String) : Nil notify, notify_by_pspec(pspec : GObject::ParamSpec) : Nil notify_by_pspec, notify_signal notify_signal, property(property_name : String, value : _) : Nil property, qdata(quark : UInt32) : Pointer(Void) | Nil qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void) | Nil) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void) | Nil steal_data, steal_qdata(quark : UInt32) : Pointer(Void) | Nil steal_qdata, thaw_notify : Nil thaw_notify, to_unsafe : Pointer(Void) to_unsafe, watch_closure(closure : GObject::Closure) : Nil watch_closure

Constructor methods inherited from class GObject::Object

cast(obj : GObject::Object) : self cast, new(pointer : Pointer(Void), transfer : GICrystal::Transfer)
new
new
, newv(object_type : UInt64, parameters : Enumerable(GObject::Parameter)) : self newv

Class methods inherited from class GObject::Object

cast?(obj : GObject::Object) : self | Nil cast?, compat_control(what : UInt64, data : Pointer(Void) | Nil) : UInt64 compat_control, g_type : UInt64 g_type, interface_find_property(g_iface : GObject::TypeInterface, property_name : String) : GObject::ParamSpec interface_find_property, interface_list_properties(g_iface : GObject::TypeInterface) : Enumerable(GObject::ParamSpec) interface_list_properties

Constructor Detail

def self.new(name : String | Nil) : self #

Creates a Gtk::TextTag.


[View source]
def self.new #

Initialize a new TextTag.


[View source]
def self.new(*, accumulative_margin : Bool | Nil = nil, allow_breaks : Bool | Nil = nil, allow_breaks_set : Bool | Nil = nil, background : String | Nil = nil, background_full_height : Bool | Nil = nil, background_full_height_set : Bool | Nil = nil, background_rgba : Gdk::RGBA | Nil = nil, background_set : Bool | Nil = nil, direction : Gtk::TextDirection | Nil = nil, editable : Bool | Nil = nil, editable_set : Bool | Nil = nil, fallback : Bool | Nil = nil, fallback_set : Bool | Nil = nil, family : String | Nil = nil, family_set : Bool | Nil = nil, font : String | Nil = nil, font_desc : Pango::FontDescription | Nil = nil, font_features : String | Nil = nil, font_features_set : Bool | Nil = nil, foreground : String | Nil = nil, foreground_rgba : Gdk::RGBA | Nil = nil, foreground_set : Bool | Nil = nil, indent : Int32 | Nil = nil, indent_set : Bool | Nil = nil, insert_hyphens : Bool | Nil = nil, insert_hyphens_set : Bool | Nil = nil, invisible : Bool | Nil = nil, invisible_set : Bool | Nil = nil, justification : Gtk::Justification | Nil = nil, justification_set : Bool | Nil = nil, language : String | Nil = nil, language_set : Bool | Nil = nil, left_margin : Int32 | Nil = nil, left_margin_set : Bool | Nil = nil, letter_spacing : Int32 | Nil = nil, letter_spacing_set : Bool | Nil = nil, line_height : Float32 | Nil = nil, line_height_set : Bool | Nil = nil, name : String | Nil = nil, overline : Pango::Overline | Nil = nil, overline_rgba : Gdk::RGBA | Nil = nil, overline_rgba_set : Bool | Nil = nil, overline_set : Bool | Nil = nil, paragraph_background : String | Nil = nil, paragraph_background_rgba : Gdk::RGBA | Nil = nil, paragraph_background_set : Bool | Nil = nil, pixels_above_lines : Int32 | Nil = nil, pixels_above_lines_set : Bool | Nil = nil, pixels_below_lines : Int32 | Nil = nil, pixels_below_lines_set : Bool | Nil = nil, pixels_inside_wrap : Int32 | Nil = nil, pixels_inside_wrap_set : Bool | Nil = nil, right_margin : Int32 | Nil = nil, right_margin_set : Bool | Nil = nil, rise : Int32 | Nil = nil, rise_set : Bool | Nil = nil, scale : Float64 | Nil = nil, scale_set : Bool | Nil = nil, sentence : Bool | Nil = nil, sentence_set : Bool | Nil = nil, show_spaces : Pango::ShowFlags | Nil = nil, show_spaces_set : Bool | Nil = nil, size : Int32 | Nil = nil, size_points : Float64 | Nil = nil, size_set : Bool | Nil = nil, stretch : Pango::Stretch | Nil = nil, stretch_set : Bool | Nil = nil, strikethrough : Bool | Nil = nil, strikethrough_rgba : Gdk::RGBA | Nil = nil, strikethrough_rgba_set : Bool | Nil = nil, strikethrough_set : Bool | Nil = nil, style : Pango::Style | Nil = nil, style_set : Bool | Nil = nil, tabs : Pango::TabArray | Nil = nil, tabs_set : Bool | Nil = nil, text_transform : Pango::TextTransform | Nil = nil, text_transform_set : Bool | Nil = nil, underline : Pango::Underline | Nil = nil, underline_rgba : Gdk::RGBA | Nil = nil, underline_rgba_set : Bool | Nil = nil, underline_set : Bool | Nil = nil, variant : Pango::Variant | Nil = nil, variant_set : Bool | Nil = nil, weight : Int32 | Nil = nil, weight_set : Bool | Nil = nil, word : Bool | Nil = nil, word_set : Bool | Nil = nil, wrap_mode : Gtk::WrapMode | Nil = nil, wrap_mode_set : Bool | Nil = nil) #

[View source]

Class Method Detail

def self.g_type : UInt64 #

Returns the type id (GType) registered in GLib type system.


[View source]

Instance Method Detail

def ==(other : self) #
Description copied from class Reference

Returns true if this reference is the same as other. Invokes same?.


def accumulative_margin=(value : Bool) : Bool #

[View source]
def accumulative_margin? : Bool #

[View source]
def allow_breaks=(value : Bool) : Bool #

[View source]
def allow_breaks? : Bool #

[View source]
def allow_breaks_set=(value : Bool) : Bool #

[View source]
def allow_breaks_set? : Bool #

[View source]
def background=(value : String) : String #

[View source]
def background_full_height=(value : Bool) : Bool #

[View source]
def background_full_height? : Bool #

[View source]
def background_full_height_set=(value : Bool) : Bool #

[View source]
def background_full_height_set? : Bool #

[View source]
def background_rgba : Gdk::RGBA | Nil #

[View source]
def background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def background_set=(value : Bool) : Bool #

[View source]
def background_set? : Bool #

[View source]
def changed(size_changed : Bool) : Nil #

Emits the [signal@Gtk.TextTagTable::tag-changed] signal on the Gtk::TextTagTable where the tag is included.

The signal is already emitted when setting a Gtk::TextTag property. This function is useful for a Gtk::TextTag subclass.


[View source]
def direction : Gtk::TextDirection #

[View source]
def direction=(value : Gtk::TextDirection) : Gtk::TextDirection #

[View source]
def editable=(value : Bool) : Bool #

[View source]
def editable? : Bool #

[View source]
def editable_set=(value : Bool) : Bool #

[View source]
def editable_set? : Bool #

[View source]
def fallback=(value : Bool) : Bool #

[View source]
def fallback? : Bool #

[View source]
def fallback_set=(value : Bool) : Bool #

[View source]
def fallback_set? : Bool #

[View source]
def family : String #

[View source]
def family=(value : String) : String #

[View source]
def family_set=(value : Bool) : Bool #

[View source]
def family_set? : Bool #

[View source]
def font : String #

[View source]
def font=(value : String) : String #

[View source]
def font_desc : Pango::FontDescription | Nil #

[View source]
def font_desc=(value : Pango::FontDescription | Nil) : Pango::FontDescription | Nil #

[View source]
def font_features : String #

[View source]
def font_features=(value : String) : String #

[View source]
def font_features_set=(value : Bool) : Bool #

[View source]
def font_features_set? : Bool #

[View source]
def foreground=(value : String) : String #

[View source]
def foreground_rgba : Gdk::RGBA | Nil #

[View source]
def foreground_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def foreground_set=(value : Bool) : Bool #

[View source]
def foreground_set? : Bool #

[View source]
def hash(hasher) #
Description copied from class Reference

See Object#hash(hasher)


def indent : Int32 #

[View source]
def indent=(value : Int32) : Int32 #

[View source]
def indent_set=(value : Bool) : Bool #

[View source]
def indent_set? : Bool #

[View source]
def insert_hyphens=(value : Bool) : Bool #

[View source]
def insert_hyphens? : Bool #

[View source]
def insert_hyphens_set=(value : Bool) : Bool #

[View source]
def insert_hyphens_set? : Bool #

[View source]
def invisible=(value : Bool) : Bool #

[View source]
def invisible? : Bool #

[View source]
def invisible_set=(value : Bool) : Bool #

[View source]
def invisible_set? : Bool #

[View source]
def justification : Gtk::Justification #

[View source]
def justification=(value : Gtk::Justification) : Gtk::Justification #

[View source]
def justification_set=(value : Bool) : Bool #

[View source]
def justification_set? : Bool #

[View source]
def language : String #

[View source]
def language=(value : String) : String #

[View source]
def language_set=(value : Bool) : Bool #

[View source]
def language_set? : Bool #

[View source]
def left_margin : Int32 #

[View source]
def left_margin=(value : Int32) : Int32 #

[View source]
def left_margin_set=(value : Bool) : Bool #

[View source]
def left_margin_set? : Bool #

[View source]
def letter_spacing : Int32 #

[View source]
def letter_spacing=(value : Int32) : Int32 #

[View source]
def letter_spacing_set=(value : Bool) : Bool #

[View source]
def letter_spacing_set? : Bool #

[View source]
def line_height : Float32 #

[View source]
def line_height=(value : Float32) : Float32 #

[View source]
def line_height_set=(value : Bool) : Bool #

[View source]
def line_height_set? : Bool #

[View source]
def name : String #

[View source]
def name=(value : String) : String #

[View source]
def overline : Pango::Overline #

[View source]
def overline=(value : Pango::Overline) : Pango::Overline #

[View source]
def overline_rgba : Gdk::RGBA | Nil #

[View source]
def overline_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def overline_rgba_set=(value : Bool) : Bool #

[View source]
def overline_rgba_set? : Bool #

[View source]
def overline_set=(value : Bool) : Bool #

[View source]
def overline_set? : Bool #

[View source]
def paragraph_background=(value : String) : String #

[View source]
def paragraph_background_rgba : Gdk::RGBA | Nil #

[View source]
def paragraph_background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def paragraph_background_set=(value : Bool) : Bool #

[View source]
def paragraph_background_set? : Bool #

[View source]
def pixels_above_lines : Int32 #

[View source]
def pixels_above_lines=(value : Int32) : Int32 #

[View source]
def pixels_above_lines_set=(value : Bool) : Bool #

[View source]
def pixels_above_lines_set? : Bool #

[View source]
def pixels_below_lines : Int32 #

[View source]
def pixels_below_lines=(value : Int32) : Int32 #

[View source]
def pixels_below_lines_set=(value : Bool) : Bool #

[View source]
def pixels_below_lines_set? : Bool #

[View source]
def pixels_inside_wrap : Int32 #

[View source]
def pixels_inside_wrap=(value : Int32) : Int32 #

[View source]
def pixels_inside_wrap_set=(value : Bool) : Bool #

[View source]
def pixels_inside_wrap_set? : Bool #

[View source]
def priority : Int32 #

Get the tag priority.


[View source]
def priority=(priority : Int32) : Nil #

Sets the priority of a Gtk::TextTag.

Valid priorities start at 0 and go to one less than Gtk::TextTagTable#size. Each tag in a table has a unique priority; setting the priority of one tag shifts the priorities of all the other tags in the table to maintain a unique priority for each tag.

Higher priority tags “win” if two tags both set the same text attribute. When adding a tag to a tag table, it will be assigned the highest priority in the table by default; so normally the precedence of a set of tags is the order in which they were added to the table, or created with Gtk::TextBuffer#create_tag, which adds the tag to the buffer’s table automatically.


[View source]
def right_margin : Int32 #

[View source]
def right_margin=(value : Int32) : Int32 #

[View source]
def right_margin_set=(value : Bool) : Bool #

[View source]
def right_margin_set? : Bool #

[View source]
def rise : Int32 #

[View source]
def rise=(value : Int32) : Int32 #

[View source]
def rise_set=(value : Bool) : Bool #

[View source]
def rise_set? : Bool #

[View source]
def scale : Float64 #

[View source]
def scale=(value : Float64) : Float64 #

[View source]
def scale_set=(value : Bool) : Bool #

[View source]
def scale_set? : Bool #

[View source]
def sentence=(value : Bool) : Bool #

[View source]
def sentence? : Bool #

[View source]
def sentence_set=(value : Bool) : Bool #

[View source]
def sentence_set? : Bool #

[View source]
def show_spaces : Pango::ShowFlags #

[View source]
def show_spaces=(value : Pango::ShowFlags) : Pango::ShowFlags #

[View source]
def show_spaces_set=(value : Bool) : Bool #

[View source]
def show_spaces_set? : Bool #

[View source]
def size : Int32 #

[View source]
def size=(value : Int32) : Int32 #

[View source]
def size_points : Float64 #

[View source]
def size_points=(value : Float64) : Float64 #

[View source]
def size_set=(value : Bool) : Bool #

[View source]
def size_set? : Bool #

[View source]
def stretch : Pango::Stretch #

[View source]
def stretch=(value : Pango::Stretch) : Pango::Stretch #

[View source]
def stretch_set=(value : Bool) : Bool #

[View source]
def stretch_set? : Bool #

[View source]
def strikethrough=(value : Bool) : Bool #

[View source]
def strikethrough? : Bool #

[View source]
def strikethrough_rgba : Gdk::RGBA | Nil #

[View source]
def strikethrough_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def strikethrough_rgba_set=(value : Bool) : Bool #

[View source]
def strikethrough_rgba_set? : Bool #

[View source]
def strikethrough_set=(value : Bool) : Bool #

[View source]
def strikethrough_set? : Bool #

[View source]
def style : Pango::Style #

[View source]
def style=(value : Pango::Style) : Pango::Style #

[View source]
def style_set=(value : Bool) : Bool #

[View source]
def style_set? : Bool #

[View source]
def tabs : Pango::TabArray | Nil #

[View source]
def tabs=(value : Pango::TabArray | Nil) : Pango::TabArray | Nil #

[View source]
def tabs_set=(value : Bool) : Bool #

[View source]
def tabs_set? : Bool #

[View source]
def text_transform : Pango::TextTransform #

[View source]
def text_transform=(value : Pango::TextTransform) : Pango::TextTransform #

[View source]
def text_transform_set=(value : Bool) : Bool #

[View source]
def text_transform_set? : Bool #

[View source]
def underline : Pango::Underline #

[View source]
def underline=(value : Pango::Underline) : Pango::Underline #

[View source]
def underline_rgba : Gdk::RGBA | Nil #

[View source]
def underline_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil #

[View source]
def underline_rgba_set=(value : Bool) : Bool #

[View source]
def underline_rgba_set? : Bool #

[View source]
def underline_set=(value : Bool) : Bool #

[View source]
def underline_set? : Bool #

[View source]
def variant : Pango::Variant #

[View source]
def variant=(value : Pango::Variant) : Pango::Variant #

[View source]
def variant_set=(value : Bool) : Bool #

[View source]
def variant_set? : Bool #

[View source]
def weight : Int32 #

[View source]
def weight=(value : Int32) : Int32 #

[View source]
def weight_set=(value : Bool) : Bool #

[View source]
def weight_set? : Bool #

[View source]
def word=(value : Bool) : Bool #

[View source]
def word? : Bool #

[View source]
def word_set=(value : Bool) : Bool #

[View source]
def word_set? : Bool #

[View source]
def wrap_mode : Gtk::WrapMode #

[View source]
def wrap_mode=(value : Gtk::WrapMode) : Gtk::WrapMode #

[View source]
def wrap_mode_set=(value : Bool) : Bool #

[View source]
def wrap_mode_set? : Bool #

[View source]