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 | Nil) : self
Creates a
Gtk::TextTag
. -
.new
Initialize a new
TextTag
. - .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)
Class Method Summary
-
.g_type : UInt64
Returns the type id (GType) registered in GLib type system.
Instance Method Summary
-
#==(other : self)
Returns
true
if this reference is the same as other. - #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=(value : Nil) : Nil
Set
#background
property to nil. - #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 | Nil
- #background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #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=(value : Nil) : Nil
Set
#family
property to nil. -
#family? : String | Nil
Same as
#family
, but can return nil. - #family_set=(value : Bool) : Bool
- #family_set? : Bool
- #font : String
- #font=(value : String) : String
-
#font=(value : Nil) : Nil
Set
#font
property to nil. -
#font? : String | Nil
Same as
#font
, but can return nil. - #font_desc : Pango::FontDescription | Nil
- #font_desc=(value : Pango::FontDescription | Nil) : Pango::FontDescription | Nil
- #font_features : String
- #font_features=(value : String) : String
-
#font_features=(value : Nil) : Nil
Set
#font_features
property to nil. -
#font_features? : String | Nil
Same as
#font_features
, but can return nil. - #font_features_set=(value : Bool) : Bool
- #font_features_set? : Bool
- #foreground=(value : String) : String
-
#foreground=(value : Nil) : Nil
Set
#foreground
property to nil. - #foreground_rgba : Gdk::RGBA | Nil
- #foreground_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #foreground_set=(value : Bool) : Bool
- #foreground_set? : Bool
-
#hash(hasher)
See
Object#hash(hasher)
- #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=(value : Nil) : Nil
Set
#language
property to nil. -
#language? : String | Nil
Same as
#language
, but can return nil. - #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
-
#name=(value : Nil) : Nil
Set
#name
property to nil. -
#name? : String | Nil
Same as
#name
, but can return nil. - #overline : Pango::Overline
- #overline=(value : Pango::Overline) : Pango::Overline
- #overline_rgba : Gdk::RGBA | Nil
- #overline_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #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=(value : Nil) : Nil
Set
#paragraph_background
property to nil. - #paragraph_background_rgba : Gdk::RGBA | Nil
- #paragraph_background_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #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 | Nil
- #strikethrough_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #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 | Nil
- #tabs=(value : Pango::TabArray | Nil) : Pango::TabArray | Nil
- #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 | Nil
- #underline_rgba=(value : Gdk::RGBA | Nil) : Gdk::RGBA | Nil
- #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
==(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
Macros inherited from class GObject::Object
previous_vfunc(*args)
previous_vfunc,
previous_vfunc!(*args)
previous_vfunc!,
signal(signature)
signal
Constructor Detail
Class Method Detail
Returns the type id (GType) registered in GLib type system.
Instance Method Detail
Returns true
if this reference is the same as other. Invokes same?
.
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.