Text
Object Hierarchy:
Description:
The Text struct contains only private data.
Namespace: Clutter
Package: clutter-1.0
Content:
Properties:
-
public bool activatable { set; get; }
Toggles whether return invokes the activate signal or not.
-
public AttrList attributes { set; get; }
A list of PangoStyleAttributes to be applied to the contents of the
Text actor.
-
public Color color { set; get; }
The color used to render the text.
-
public Color cursor_color { set; get; }
The color of the cursor.
-
public bool cursor_color_set { get; }
-
public int cursor_size { set; get; }
The size of the cursor, in pixels. If set to -1 the size used will be the default cursor size of 2
pixels.
-
public bool cursor_visible { set; get; }
Whether the input cursor is visible or not, it will only be visible if both
cursor_visible and
editable are set to true.
-
public bool editable { set; get; }
Whether key events delivered to the actor causes editing.
-
public EllipsizeMode ellipsize { set; get; }
The preferred place to ellipsize the contents of the Text
actor
-
public FontDescription font_description { set; owned get; }
-
public string font_name { set; get; }
The font to be used by the Text, as a string that can be
parsed by from_string.
-
public bool justify { set; get; }
Whether the contents of the Text should be justified on
both margins.
-
public Alignment line_alignment { set; get; }
The preferred alignment for the text. This property controls the alignment of multi-line paragraphs.
-
public bool line_wrap { set; get; }
Whether to wrap the lines of text if the contents
exceed the available allocation. The wrapping strategy is controlled by the
line_wrap_mode property.
-
public WrapMode line_wrap_mode { set; get; }
If line_wrap is set to true,
this property will control how the text is wrapped.
-
public int max_length { set; get; }
The maximum length of the contents of the Text actor.
-
public uint password_char { set; get; }
If non-zero, the character that should be used in place of the actual text in a password text actor.
-
public int position { set; get; }
The current input cursor position. -1 is taken to be the end of the text
-
public bool selectable { set; get; }
Whether it is possible to select text, either using the pointer or the keyboard.
-
public Color selected_text_color { set; get; }
The color of selected text.
-
public bool selected_text_color_set { get; }
-
public int selection_bound { set; get; }
The current input cursor position. -1 is taken to be the end of the text
-
public Color selection_color { set; get; }
The color of the selection.
-
public bool selection_color_set { get; }
-
public bool single_line_mode { set; get; }
Whether the Text actor should be in single line mode or
not. A single line Text actor will only contain a single line of text, scrolling it in
case its length is bigger than the allocated size.
-
public string text { set; get; }
The text to render inside the actor.
-
public bool use_markup { set; get; }
Whether the text includes Pango markup.
Creation methods:
-
public Text ()
Creates a new Text actor. This actor can be used to
display and edit text.
-
public Text.full (string font_name, string text, Color color)
Creates a new Text actor, using font_name as
the font description; text will be used to set the contents of the actor; and color will be used as the
color to render text.
-
public Text.with_text (string? font_name, string text)
Creates a new Text actor, using font_name as
the font description; text will be used to set the contents of the actor.
Methods:
-
public void delete_chars (uint n_chars)
Deletes n_chars inside a Text actor, starting
from the current cursor position.
-
public bool delete_selection ()
Deletes the currently selected text
-
public bool get_activatable ()
Retrieves whether a Text is activatable or not.
-
public weak AttrList get_attributes ()
-
public string get_chars (ssize_t start_pos, ssize_t end_pos)
Retrieves the contents of the Text actor between
start_pos and end_pos, but not including end_pos.
-
public Color get_color ()
Retrieves the text color as set by set_color.
-
public Color get_cursor_color ()
Retrieves the color of the cursor of a Text actor.
-
public int get_cursor_position ()
Retrieves the cursor position.
-
public uint get_cursor_size ()
Retrieves the size of the cursor of a Text actor.
-
public bool get_cursor_visible ()
Retrieves whether the cursor of a Text actor is visible.
-
public bool get_editable ()
Retrieves whether a Text is editable or not.
-
public EllipsizeMode get_ellipsize ()
-
public FontDescription get_font_description ()
-
public unowned string get_font_name ()
-
public bool get_justify ()
Retrieves whether the Text actor should justify its
contents on both margins.
-
public weak Layout get_layout ()
Retrieves the current Layout used by a
Text actor.
-
public void get_layout_offsets (out int x, out int y)
Obtains the coordinates where the Text will draw the
Layout representing the text.
-
public Alignment get_line_alignment ()
-
public bool get_line_wrap ()
-
public WrapMode get_line_wrap_mode ()
Retrieves the line wrap mode used by the Text actor.
-
public int get_max_length ()
Gets the maximum length of text that can be set into a text actor.
-
public unichar get_password_char ()
Retrieves the character to use in place of the actual text as set by
set_password_char.
-
public bool get_selectable ()
Retrieves whether a Text is selectable or not.
-
public Color get_selected_text_color ()
Retrieves the color of selected text of a Text actor.
-
public string get_selection ()
Retrieves the currently selected text.
-
public int get_selection_bound ()
Retrieves the other end of the selection of a Text actor,
in characters from the current cursor position.
-
public Color get_selection_color ()
Retrieves the color of the selection of a Text actor.
-
public bool get_single_line_mode ()
Retrieves whether the Text actor is in single line mode.
-
public unowned string get_text ()
Retrieves a pointer to the current contents of a Text
actor.
-
public bool get_use_markup ()
Retrieves whether the contents of the Text actor should be
parsed for the Pango text markup.
-
public void insert_text (string text, ssize_t position)
Inserts text into a Actor at the
given position.
-
public void insert_unichar (unichar wc)
Inserts wc at the current cursor position of a
Text actor.
-
public bool position_to_coords (int position, out float x, out float y, out float line_height = null)
Retrieves the coordinates of the given position.
-
public void set_activatable (bool activatable)
Sets whether a Text actor should be activatable.
-
public void set_attributes (AttrList attrs)
Sets the attributes list that are going to be applied to the
Text contents.
-
public void set_color (Color color)
Sets the color of the contents of a Text actor.
-
public void set_cursor_color (Color color)
Sets the color of the cursor of a Text actor.
-
public void set_cursor_position (int position)
Sets the cursor of a Text actor at position.
-
public void set_cursor_size (int size)
Sets the size of the cursor of a Text. The cursor will
only be visible if the cursor_visible property is set to true
.
-
public void set_cursor_visible (bool cursor_visible)
Sets whether the cursor of a Text actor should be visible
or not.
-
public void set_editable (bool editable)
Sets whether the Text actor should be editable.
-
public void set_ellipsize (EllipsizeMode mode)
Sets the mode used to ellipsize (add an ellipsis: "...") to the text if there is not enough space to
render the entire contents of a Text actor
-
public void set_font_description (FontDescription font_desc)
Sets font_desc as the font description for a Text
-
public void set_font_name (string? font_name)
Sets the font used by a Text. The font_name
string must either be null, which means that the font name from the default
Backend will be used; or be something that can be parsed by the
from_string function, like:
-
public void set_justify (bool justify)
Sets whether the text of the Text actor should be
justified on both margins. This setting is ignored if Clutter is compiled against Pango < 1.18.
-
public void set_line_alignment (Alignment alignment)
Sets the way that the lines of a wrapped label are aligned with respect to each other. This does not
affect the overall alignment of the label within its allocated or specified width.
-
public void set_line_wrap (bool line_wrap)
Sets whether the contents of a Text actor should wrap, if
they don't fit the size assigned to the actor.
-
public void set_line_wrap_mode (WrapMode wrap_mode)
If line wrapping is enabled (see set_line_wrap
) this function controls how the line wrapping is performed. The default is
WORD which means wrap on word boundaries.
-
public void set_markup (string markup)
Sets markup as the contents of a Text.
-
public void set_max_length (int max)
Sets the maximum allowed length of the contents of the actor. If the current contents are longer than
the given length, then they will be truncated to fit.
-
public void set_password_char (unichar wc)
Sets the character to use in place of the actual text in a password text actor.
-
public void set_preedit_string (string? preedit_str, AttrList? preedit_attrs, uint cursor_pos)
Sets, or unsets, the pre-edit string. This function is useful for input methods to display a string
(with eventual specific Pango attributes) before it is entered inside the Text buffer.
-
public void set_selectable (bool selectable)
Sets whether a Text actor should be selectable.
-
public void set_selected_text_color (Color color)
Sets the selected text color of a Text actor.
-
public void set_selection (ssize_t start_pos, ssize_t end_pos)
Selects the region of text between start_pos and end_pos.
-
public void set_selection_bound (int selection_bound)
Sets the other end of the selection, starting from the current cursor position.
-
public void set_selection_color (Color color)
Sets the color of the selection of a Text actor.
-
public void set_single_line_mode (bool single_line)
Sets whether a Text actor should be in single line mode or
not. Only editable Texts can be in single line mode.
-
public void set_text (string text)
Sets the contents of a Text actor.
-
public void set_use_markup (bool setting)
Signals: