class Gtk::TextTag
- Gtk::TextTag
- GObject::Object
- Reference
- Object
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.crConstructors
-
.new(name : String?) : self
Creates a
Gtk::TextTag
. -
.new
Initialize a new
TextTag
. - .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 Summary
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
- #accumulative_margin=(value : Bool) : Bool
- #accumulative_margin? : Bool
- #allow_breaks=(value : Bool) : Bool
- #allow_breaks? : Bool
- #allow_breaks_set=(value : Bool) : Bool
- #allow_breaks_set? : Bool
- #background=(value : String) : String
- #background_full_height=(value : Bool) : Bool
- #background_full_height? : Bool
- #background_full_height_set=(value : Bool) : Bool
- #background_full_height_set? : Bool
- #background_rgba : Gdk::RGBA?
- #background_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #background_set=(value : Bool) : Bool
- #background_set? : Bool
-
#changed(size_changed : Bool) : Nil
Emits the [signal@Gtk.TextTagTable::tag-changed] signal on the
Gtk::TextTagTable
where the tag is included. - #direction : Gtk::TextDirection
- #direction=(value : Gtk::TextDirection) : Gtk::TextDirection
- #editable=(value : Bool) : Bool
- #editable? : Bool
- #editable_set=(value : Bool) : Bool
- #editable_set? : Bool
- #fallback=(value : Bool) : Bool
- #fallback? : Bool
- #fallback_set=(value : Bool) : Bool
- #fallback_set? : Bool
- #family : String
- #family=(value : String) : String
- #family_set=(value : Bool) : Bool
- #family_set? : Bool
- #font : String
- #font=(value : String) : String
- #font_desc : Pango::FontDescription?
- #font_desc=(value : Pango::FontDescription?) : Pango::FontDescription?
- #font_features : String
- #font_features=(value : String) : String
- #font_features_set=(value : Bool) : Bool
- #font_features_set? : Bool
- #foreground=(value : String) : String
- #foreground_rgba : Gdk::RGBA?
- #foreground_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #foreground_set=(value : Bool) : Bool
- #foreground_set? : Bool
- #indent : Int32
- #indent=(value : Int32) : Int32
- #indent_set=(value : Bool) : Bool
- #indent_set? : Bool
- #insert_hyphens=(value : Bool) : Bool
- #insert_hyphens? : Bool
- #insert_hyphens_set=(value : Bool) : Bool
- #insert_hyphens_set? : Bool
- #invisible=(value : Bool) : Bool
- #invisible? : Bool
- #invisible_set=(value : Bool) : Bool
- #invisible_set? : Bool
- #justification : Gtk::Justification
- #justification=(value : Gtk::Justification) : Gtk::Justification
- #justification_set=(value : Bool) : Bool
- #justification_set? : Bool
- #language : String
- #language=(value : String) : String
- #language_set=(value : Bool) : Bool
- #language_set? : Bool
- #left_margin : Int32
- #left_margin=(value : Int32) : Int32
- #left_margin_set=(value : Bool) : Bool
- #left_margin_set? : Bool
- #letter_spacing : Int32
- #letter_spacing=(value : Int32) : Int32
- #letter_spacing_set=(value : Bool) : Bool
- #letter_spacing_set? : Bool
- #line_height : Float32
- #line_height=(value : Float32) : Float32
- #line_height_set=(value : Bool) : Bool
- #line_height_set? : Bool
- #name : String
- #name=(value : String) : String
- #overline : Pango::Overline
- #overline=(value : Pango::Overline) : Pango::Overline
- #overline_rgba : Gdk::RGBA?
- #overline_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #overline_rgba_set=(value : Bool) : Bool
- #overline_rgba_set? : Bool
- #overline_set=(value : Bool) : Bool
- #overline_set? : Bool
- #paragraph_background=(value : String) : String
- #paragraph_background_rgba : Gdk::RGBA?
- #paragraph_background_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #paragraph_background_set=(value : Bool) : Bool
- #paragraph_background_set? : Bool
- #pixels_above_lines : Int32
- #pixels_above_lines=(value : Int32) : Int32
- #pixels_above_lines_set=(value : Bool) : Bool
- #pixels_above_lines_set? : Bool
- #pixels_below_lines : Int32
- #pixels_below_lines=(value : Int32) : Int32
- #pixels_below_lines_set=(value : Bool) : Bool
- #pixels_below_lines_set? : Bool
- #pixels_inside_wrap : Int32
- #pixels_inside_wrap=(value : Int32) : Int32
- #pixels_inside_wrap_set=(value : Bool) : Bool
- #pixels_inside_wrap_set? : Bool
-
#priority : Int32
Get the tag priority.
-
#priority=(priority : Int32) : Nil
Sets the priority of a
Gtk::TextTag
. - #right_margin : Int32
- #right_margin=(value : Int32) : Int32
- #right_margin_set=(value : Bool) : Bool
- #right_margin_set? : Bool
- #rise : Int32
- #rise=(value : Int32) : Int32
- #rise_set=(value : Bool) : Bool
- #rise_set? : Bool
- #scale : Float64
- #scale=(value : Float64) : Float64
- #scale_set=(value : Bool) : Bool
- #scale_set? : Bool
- #sentence=(value : Bool) : Bool
- #sentence? : Bool
- #sentence_set=(value : Bool) : Bool
- #sentence_set? : Bool
- #show_spaces : Pango::ShowFlags
- #show_spaces=(value : Pango::ShowFlags) : Pango::ShowFlags
- #show_spaces_set=(value : Bool) : Bool
- #show_spaces_set? : Bool
- #size : Int32
- #size=(value : Int32) : Int32
- #size_points : Float64
- #size_points=(value : Float64) : Float64
- #size_set=(value : Bool) : Bool
- #size_set? : Bool
- #stretch : Pango::Stretch
- #stretch=(value : Pango::Stretch) : Pango::Stretch
- #stretch_set=(value : Bool) : Bool
- #stretch_set? : Bool
- #strikethrough=(value : Bool) : Bool
- #strikethrough? : Bool
- #strikethrough_rgba : Gdk::RGBA?
- #strikethrough_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #strikethrough_rgba_set=(value : Bool) : Bool
- #strikethrough_rgba_set? : Bool
- #strikethrough_set=(value : Bool) : Bool
- #strikethrough_set? : Bool
- #style : Pango::Style
- #style=(value : Pango::Style) : Pango::Style
- #style_set=(value : Bool) : Bool
- #style_set? : Bool
- #tabs : Pango::TabArray?
- #tabs=(value : Pango::TabArray?) : Pango::TabArray?
- #tabs_set=(value : Bool) : Bool
- #tabs_set? : Bool
- #text_transform : Pango::TextTransform
- #text_transform=(value : Pango::TextTransform) : Pango::TextTransform
- #text_transform_set=(value : Bool) : Bool
- #text_transform_set? : Bool
- #underline : Pango::Underline
- #underline=(value : Pango::Underline) : Pango::Underline
- #underline_rgba : Gdk::RGBA?
- #underline_rgba=(value : Gdk::RGBA?) : Gdk::RGBA?
- #underline_rgba_set=(value : Bool) : Bool
- #underline_rgba_set? : Bool
- #underline_set=(value : Bool) : Bool
- #underline_set? : Bool
- #variant : Pango::Variant
- #variant=(value : Pango::Variant) : Pango::Variant
- #variant_set=(value : Bool) : Bool
- #variant_set? : Bool
- #weight : Int32
- #weight=(value : Int32) : Int32
- #weight_set=(value : Bool) : Bool
- #weight_set? : Bool
- #word=(value : Bool) : Bool
- #word? : Bool
- #word_set=(value : Bool) : Bool
- #word_set? : Bool
- #wrap_mode : Gtk::WrapMode
- #wrap_mode=(value : Gtk::WrapMode) : Gtk::WrapMode
- #wrap_mode_set=(value : Bool) : Bool
- #wrap_mode_set? : Bool
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
Class Method Detail
Instance Method Detail
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.
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.