Clutter.TextBuffer¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r |
Length of the text currently in the buffer |
||
r/w |
Maximum number of characters for this entry. Zero if no maximum |
||
r |
The contents of the buffer |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted after text is deleted from the buffer. |
|
This signal is emitted after text is inserted into the buffer. |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent_instance |
r |
Class Details¶
- class Clutter.TextBuffer(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
The
Clutter.TextBuffer
structure contains private data and it should only be accessed using the provided API.New in version 1.10.
- classmethod new()¶
- Returns:
A new
Clutter.TextBuffer
object.- Return type:
Create a new
Clutter.TextBuffer
object.New in version 1.10.
- classmethod new_with_text(text, text_len)¶
- Parameters:
- Returns:
A new
Clutter.TextBuffer
object.- Return type:
Create a new
Clutter.TextBuffer
object with some text.New in version 1.10.
- delete_text(position, n_chars)¶
- Parameters:
- Returns:
The number of characters deleted.
- Return type:
Deletes a sequence of characters from the buffer. n_chars characters are deleted starting at position. If n_chars is negative, then all characters until the end of the text are deleted.
If position or n_chars are out of bounds, then they are coerced to sane values.
Note that the positions are specified in characters, not bytes.
New in version 1.10.
- emit_deleted_text(position, n_chars)¶
- Parameters:
Emits the
Clutter.TextBuffer
::deleted-text
signal on self.Used when subclassing
Clutter.TextBuffer
New in version 1.10.
- emit_inserted_text(position, chars, n_chars)¶
- Parameters:
Emits the
Clutter.TextBuffer
::inserted-text
signal on self.Used when subclassing
Clutter.TextBuffer
New in version 1.10.
- get_bytes()¶
- Returns:
The byte length of the buffer.
- Return type:
Retrieves the length in bytes of the buffer. See
Clutter.TextBuffer.get_length
().New in version 1.10.
- get_length()¶
- Returns:
The number of characters in the buffer.
- Return type:
Retrieves the length in characters of the buffer.
New in version 1.10.
- get_max_length()¶
- Returns:
the maximum allowed number of characters in
Clutter.TextBuffer
, or 0 if there is no maximum.- Return type:
Retrieves the maximum allowed length of the text in self. See
Clutter.TextBuffer.set_max_length
().New in version 1.10.
- get_text()¶
- Returns:
a pointer to the contents of the widget as a string. This string points to internally allocated storage in the buffer and must not be freed, modified or stored.
- Return type:
Retrieves the contents of the buffer.
The memory pointer returned by this call will not change unless this object emits a signal, or is finalized.
New in version 1.10.
- insert_text(position, chars, n_chars)¶
- Parameters:
- Returns:
The number of characters actually inserted.
- Return type:
Inserts n_chars characters of chars into the contents of the buffer, at position position.
If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.
Note that the position and length are in characters, not in bytes.
New in version 1.10.
- set_max_length(max_length)¶
- Parameters:
max_length (
int
) – the maximum length of the entry buffer, or 0 for no maximum. (other than the maximum length of entries.) The value passed in will be clamped to the range [ 0, %CLUTTER_TEXT_BUFFER_MAX_SIZE ].
Sets the maximum allowed length of the contents of the buffer. If the current contents are longer than the given length, then they will be truncated to fit.
New in version 1.10.
- set_text(chars, n_chars)¶
-
Sets the text in the buffer.
This is roughly equivalent to calling
Clutter.TextBuffer.delete_text
() andClutter.TextBuffer.insert_text
().Note that n_chars is in characters, not in bytes.
New in version 1.10.
- do_delete_text(position, n_chars) virtual¶
- Parameters:
- Returns:
The number of characters deleted.
- Return type:
Deletes a sequence of characters from the buffer. n_chars characters are deleted starting at position. If n_chars is negative, then all characters until the end of the text are deleted.
If position or n_chars are out of bounds, then they are coerced to sane values.
Note that the positions are specified in characters, not bytes.
New in version 1.10.
- do_get_length() virtual¶
- Returns:
The number of characters in the buffer.
- Return type:
Retrieves the length in characters of the buffer.
New in version 1.10.
- do_insert_text(position, chars, n_chars) virtual¶
- Parameters:
- Returns:
The number of characters actually inserted.
- Return type:
Inserts n_chars characters of chars into the contents of the buffer, at position position.
If n_chars is negative, then characters from chars will be inserted until a null-terminator is found. If position or n_chars are out of bounds, or the maximum buffer text length is exceeded, then they are coerced to sane values.
Note that the position and length are in characters, not in bytes.
New in version 1.10.
Signal Details¶
- Clutter.TextBuffer.signals.deleted_text(text_buffer, position, n_chars)¶
- Signal Name:
deleted-text
- Flags:
- Parameters:
text_buffer (
Clutter.TextBuffer
) – The object which received the signalposition (
int
) – the position the text was deleted at.n_chars (
int
) – The number of characters that were deleted.
This signal is emitted after text is deleted from the buffer.
New in version 1.10.
- Clutter.TextBuffer.signals.inserted_text(text_buffer, position, chars, n_chars)¶
- Signal Name:
inserted-text
- Flags:
- Parameters:
text_buffer (
Clutter.TextBuffer
) – The object which received the signalposition (
int
) – the position the text was inserted at.chars (
str
) – The text that was inserted.n_chars (
int
) – The number of characters that were inserted.
This signal is emitted after text is inserted into the buffer.
New in version 1.10.
Property Details¶
- Clutter.TextBuffer.props.length¶
-
The length (in characters) of the text in buffer.
New in version 1.10.
- Clutter.TextBuffer.props.max_length¶
-
The maximum length (in characters) of the text in the buffer.
New in version 1.10.