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

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)? data, finalize finalize, freeze_notify : Nil freeze_notify, getv(names : Enumerable(String), values : Enumerable(_)) : Nil getv, 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)? qdata, ref_count : UInt32 ref_count, run_dispose : Nil run_dispose, set_data(key : String, data : Pointer(Void)?) : Nil set_data, set_property(property_name : String, value : _) : Nil set_property, steal_data(key : String) : Pointer(Void)? steal_data, steal_qdata(quark : UInt32) : Pointer(Void)? 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, 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

compat_control(what : UInt64, data : Pointer(Void)?) : 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?) : self #

Creates a Gtk::TextTag.


def self.new #

Initialize a new TextTag.


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

Class Method Detail

def self.g_type : UInt64 #

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


Instance Method Detail

def accumulative_margin=(value : Bool) : Bool #

def accumulative_margin? : Bool #

def allow_breaks=(value : Bool) : Bool #

def allow_breaks? : Bool #

def allow_breaks_set=(value : Bool) : Bool #

def allow_breaks_set? : Bool #

def background=(value : String) : String #

def background_full_height=(value : Bool) : Bool #

def background_full_height? : Bool #

def background_full_height_set=(value : Bool) : Bool #

def background_full_height_set? : Bool #

def background_rgba : Gdk::RGBA? #

def background_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def background_set=(value : Bool) : Bool #

def background_set? : Bool #

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.


def direction : Gtk::TextDirection #

def direction=(value : Gtk::TextDirection) : Gtk::TextDirection #

def editable=(value : Bool) : Bool #

def editable? : Bool #

def editable_set=(value : Bool) : Bool #

def editable_set? : Bool #

def fallback=(value : Bool) : Bool #

def fallback? : Bool #

def fallback_set=(value : Bool) : Bool #

def fallback_set? : Bool #

def family : String #

def family=(value : String) : String #

def family_set=(value : Bool) : Bool #

def family_set? : Bool #

def font : String #

def font=(value : String) : String #

def font_desc : Pango::FontDescription? #

def font_desc=(value : Pango::FontDescription?) : Pango::FontDescription? #

def font_features : String #

def font_features=(value : String) : String #

def font_features_set=(value : Bool) : Bool #

def font_features_set? : Bool #

def foreground=(value : String) : String #

def foreground_rgba : Gdk::RGBA? #

def foreground_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def foreground_set=(value : Bool) : Bool #

def foreground_set? : Bool #

def indent : Int32 #

def indent=(value : Int32) : Int32 #

def indent_set=(value : Bool) : Bool #

def indent_set? : Bool #

def insert_hyphens=(value : Bool) : Bool #

def insert_hyphens? : Bool #

def insert_hyphens_set=(value : Bool) : Bool #

def insert_hyphens_set? : Bool #

def invisible=(value : Bool) : Bool #

def invisible? : Bool #

def invisible_set=(value : Bool) : Bool #

def invisible_set? : Bool #

def justification : Gtk::Justification #

def justification=(value : Gtk::Justification) : Gtk::Justification #

def justification_set=(value : Bool) : Bool #

def justification_set? : Bool #

def language : String #

def language=(value : String) : String #

def language_set=(value : Bool) : Bool #

def language_set? : Bool #

def left_margin : Int32 #

def left_margin=(value : Int32) : Int32 #

def left_margin_set=(value : Bool) : Bool #

def left_margin_set? : Bool #

def letter_spacing : Int32 #

def letter_spacing=(value : Int32) : Int32 #

def letter_spacing_set=(value : Bool) : Bool #

def letter_spacing_set? : Bool #

def line_height : Float32 #

def line_height=(value : Float32) : Float32 #

def line_height_set=(value : Bool) : Bool #

def line_height_set? : Bool #

def name : String #

def name=(value : String) : String #

def overline : Pango::Overline #

def overline=(value : Pango::Overline) : Pango::Overline #

def overline_rgba : Gdk::RGBA? #

def overline_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def overline_rgba_set=(value : Bool) : Bool #

def overline_rgba_set? : Bool #

def overline_set=(value : Bool) : Bool #

def overline_set? : Bool #

def paragraph_background=(value : String) : String #

def paragraph_background_rgba : Gdk::RGBA? #

def paragraph_background_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def paragraph_background_set=(value : Bool) : Bool #

def paragraph_background_set? : Bool #

def pixels_above_lines : Int32 #

def pixels_above_lines=(value : Int32) : Int32 #

def pixels_above_lines_set=(value : Bool) : Bool #

def pixels_above_lines_set? : Bool #

def pixels_below_lines : Int32 #

def pixels_below_lines=(value : Int32) : Int32 #

def pixels_below_lines_set=(value : Bool) : Bool #

def pixels_below_lines_set? : Bool #

def pixels_inside_wrap : Int32 #

def pixels_inside_wrap=(value : Int32) : Int32 #

def pixels_inside_wrap_set=(value : Bool) : Bool #

def pixels_inside_wrap_set? : Bool #

def priority : Int32 #

Get the tag priority.


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.


def right_margin : Int32 #

def right_margin=(value : Int32) : Int32 #

def right_margin_set=(value : Bool) : Bool #

def right_margin_set? : Bool #

def rise : Int32 #

def rise=(value : Int32) : Int32 #

def rise_set=(value : Bool) : Bool #

def rise_set? : Bool #

def scale : Float64 #

def scale=(value : Float64) : Float64 #

def scale_set=(value : Bool) : Bool #

def scale_set? : Bool #

def sentence=(value : Bool) : Bool #

def sentence? : Bool #

def sentence_set=(value : Bool) : Bool #

def sentence_set? : Bool #

def show_spaces : Pango::ShowFlags #

def show_spaces=(value : Pango::ShowFlags) : Pango::ShowFlags #

def show_spaces_set=(value : Bool) : Bool #

def show_spaces_set? : Bool #

def size : Int32 #

def size=(value : Int32) : Int32 #

def size_points : Float64 #

def size_points=(value : Float64) : Float64 #

def size_set=(value : Bool) : Bool #

def size_set? : Bool #

def stretch : Pango::Stretch #

def stretch=(value : Pango::Stretch) : Pango::Stretch #

def stretch_set=(value : Bool) : Bool #

def stretch_set? : Bool #

def strikethrough=(value : Bool) : Bool #

def strikethrough? : Bool #

def strikethrough_rgba : Gdk::RGBA? #

def strikethrough_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def strikethrough_rgba_set=(value : Bool) : Bool #

def strikethrough_rgba_set? : Bool #

def strikethrough_set=(value : Bool) : Bool #

def strikethrough_set? : Bool #

def style : Pango::Style #

def style=(value : Pango::Style) : Pango::Style #

def style_set=(value : Bool) : Bool #

def style_set? : Bool #

def tabs : Pango::TabArray? #

def tabs=(value : Pango::TabArray?) : Pango::TabArray? #

def tabs_set=(value : Bool) : Bool #

def tabs_set? : Bool #

def text_transform : Pango::TextTransform #

def text_transform=(value : Pango::TextTransform) : Pango::TextTransform #

def text_transform_set=(value : Bool) : Bool #

def text_transform_set? : Bool #

def underline : Pango::Underline #

def underline=(value : Pango::Underline) : Pango::Underline #

def underline_rgba : Gdk::RGBA? #

def underline_rgba=(value : Gdk::RGBA?) : Gdk::RGBA? #

def underline_rgba_set=(value : Bool) : Bool #

def underline_rgba_set? : Bool #

def underline_set=(value : Bool) : Bool #

def underline_set? : Bool #

def variant : Pango::Variant #

def variant=(value : Pango::Variant) : Pango::Variant #

def variant_set=(value : Bool) : Bool #

def variant_set? : Bool #

def weight : Int32 #

def weight=(value : Int32) : Int32 #

def weight_set=(value : Bool) : Bool #

def weight_set? : Bool #

def word=(value : Bool) : Bool #

def word? : Bool #

def word_set=(value : Bool) : Bool #

def word_set? : Bool #

def wrap_mode : Gtk::WrapMode #

def wrap_mode=(value : Gtk::WrapMode) : Gtk::WrapMode #

def wrap_mode_set=(value : Bool) : Bool #

def wrap_mode_set? : Bool #