gtk.EntryBuffer
gtk.EntryBuffer — stores text for display in a gtk.Entry
(new in PyGTK 2.22)
Synopsis
class gtk.EntryBuffer: |
gtk.EntryBuffer Properties
|
gtk.EntryBuffer Signal Prototypes
def callback( | |
def callback( |
Description
The gtk.EntryBuffer
class contains the actual text displayed in a
gtk.Entry
widget.
A single gtk.EntryBuffer
object can be shared by multiple
gtk.Entry
widgets which will then share the same text content, but not the cursor
position, visibility attributes, icon etc.
gtk.EntryBuffer
may be derived from. Such a derived class might allow
text to be stored in an alternate location, such as non-pageable memory, useful in the case of important passwords. Or a derived class could
integrate with an application's concept of undo/redo.
Constructor
gtk.EntryBuffer(initial_chars
, n_initial_chars
)
| initial buffer text, or None . |
| number of characters in initial_chars , or -1. |
Returns : | a new gtk.EntryBuffer . |
Note
This constructor is available in PyGTK 2.22 and above.
Creates a new gtk.EntryBuffer
object.
Methods
gtk.EntryBuffer.get_bytes
def get_bytes()
Returns : | the byte length of the buffer. |
Note
This method is available in PyGTK 2.22 and above.
The get_bytes
() method retrieves the length in bytes of the buffer.
See gtk.EntryBuffer.get_length
().
gtk.EntryBuffer.get_length
def get_length()
Returns : | the number of characters in the buffer. |
Note
This method is available in PyGTK 2.22 and above.
The get_length
() method retrieves the length in characters of the buffer.
gtk.EntryBuffer.set_text
def set_text(chars
, n_chars
)
| the new text |
| the number of characters, or -1 |
Note
This method is available in PyGTK 2.22 and above.
The set_text
() method sets the text in the buffer.
gtk.EntryBuffer.get_text
def get_text()
Returns : | the contents of the buffer. |
Note
This method is available in PyGTK 2.22 and above.
The get_text
() method retrieves the contents of the buffer.
gtk.EntryBuffer.set_max_length
def set_max_length(max_length
)
| 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-65536. |
Note
This method is available in PyGTK 2.22 and above.
The set_max_length
() 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.
gtk.EntryBuffer.get_max_length
def get_max_length()
Returns : | the maximum allowed number of characters in the entry buffer, or 0 if there is no maximum. |
Note
This method is available in PyGTK 2.22 and above.
The get_max_length
() method retrieves the maximum allowed length of the text in buffer.
See gtk.EntryBuffer.set_max_length
().
gtk.EntryBuffer.insert_text
def insert_text(position
, chars
, n_chars
)
| the position at which to insert text. |
| the text to insert into the buffer. |
| the length of the text in characters, or -1. |
Note
This method is available in PyGTK 2.22 and above.
The insert_text
() method inserts n_chars characters of chars into the contents of the buffer, at position position.
gtk.EntryBuffer.delete_text
def delete_text(position
, n_chars
)
| the position at which to delete text. |
| the number of characters to delete. |
Note
This method is available in PyGTK 2.22 and above.
The delete_text
() method 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. .
gtk.EntryBuffer.emit_inserted_text
def emit_inserted_text(position
, chars
, n_chars
)
| the position at which text was inserted. |
| the text that was inserted. |
| the number of characters inserted. |
Note
This method is available in PyGTK 2.22 and above.
The emit_inserted_text
() method can be used when subclassing
gtk.EntryBuffer
.
gtk.EntryBuffer.emit_deleted_text
def emit_deleted_text(position
, n_chars
)
| the position at which text was deleted. |
| the number of characters deleted. |
Note
This method is available in PyGTK 2.22 and above.
The emit_deleted_text
() method can be used when subclassing
gtk.EntryBuffer
.
Signals
The "deleted-text" gtk.EntryBuffer Signal
def callback(buffer
, position
, n_chars
, user_param1
, ...
)
| the buffer that received the signal |
| the the position the text was deleted at |
| the number of characters that were deleted |
| the first user parameter (if any) specified with the connect () |
| additional user parameters (if any) |
The "activate" signal is emitted after text is deleted from the buffer.
The "inserted-text" gtk.EntryBuffer Signal
def callback(buffer
, position
, chars
, n_chars
, user_param1
, ...
)
| the buffer that received the signal |
| the position the text was inserted at |
| the text that was inserted |
| the number of characters that were inserted |
| the first user parameter (if any) specified with the connect () |
| additional user parameters (if any) |
The "activate" signal is emitted after text is inserted into the buffer.