gtk.EntryBufferstores text for display in a gtk.Entry (new in PyGTK 2.22)Synopsisgtk.EntryBuffergtk.EntryBufferinitial_charsn_initial_charsget_bytesget_lengthset_textcharsn_charsget_textset_max_lengthmax_lengthget_max_lengthinsert_textpositioncharsn_charsdelete_textpositionn_charsemit_inserted_textpositioncharsn_charsemit_deleted_textpositionn_charsAncestry+-- gobject.GObject
+-- gtk.EntryBuffer
gtk.EntryBuffer Properties
"length"ReadThe length (in characters) of the text in buffer. Allowed values: <=65535. Default value: 0."max-length"Read/WriteThe maximum length (in characters) of the text in the buffer. Allowed values: <=65535. Default value: 0."text"Read/WriteThe contents of the buffer. Default value: "".
gtk.EntryBuffer Signal Prototypesgobject.GObject Signal Prototypes"deleted-text"callbackbufferpositionn_charsuser_param1..."inserted-text"callbackbufferpositioncharsn_charsuser_param1...DescriptionThe 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.Constructorgtk.EntryBufferinitial_charsn_initial_charsinitial_chars :initial buffer text, or None.n_initial_chars :number of characters in initial_chars, or -1.Returns :a new gtk.EntryBuffer.This constructor is available in PyGTK 2.22 and above.Creates a new gtk.EntryBuffer object.Methodsgtk.EntryBuffer.get_bytesget_bytesReturns :the byte length of the buffer.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_lengthget_lengthReturns :the number of characters in the buffer.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_textset_textcharsn_charschars :the new textn_chars :the number of characters, or -1This method is available in PyGTK 2.22 and above.The set_text() method sets the text in the buffer.gtk.EntryBuffer.get_textget_textReturns :the contents of the buffer.This method is available in PyGTK 2.22 and above.The get_text() method retrieves the contents of the buffer.gtk.EntryBuffer.set_max_lengthset_max_lengthmax_lengthmax_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.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_lengthget_max_lengthReturns :the maximum allowed number of characters in the entry buffer, or 0 if there is no maximum.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_textinsert_textpositioncharsn_charsposition :the position at which to insert text.chars :the text to insert into the buffer.n_chars :the length of the text in characters, or -1.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_textdelete_textpositionn_charsposition :the position at which to delete text.n_chars :the number of characters to delete.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_textemit_inserted_textpositioncharsn_charsposition :the position at which text was inserted.chars :the text that was inserted.n_chars :the number of characters inserted.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_textemit_deleted_textpositionn_charsposition :the position at which text was deleted.n_chars :the number of characters deleted.This method is available in PyGTK 2.22 and above.The emit_deleted_text() method can be used when subclassing
gtk.EntryBuffer.SignalsThe "deleted-text" gtk.EntryBuffer Signalcallbackbufferpositionn_charsuser_param1...buffer :the buffer that received the signalposition :the the position the text was deleted atn_chars :the number of characters that were deleteduser_param1 :the first user parameter (if any) specified with the connect() method... :additional user parameters (if any)The "activate" signal is emitted after text is deleted from the buffer.The "inserted-text" gtk.EntryBuffer Signalcallbackbufferpositioncharsn_charsuser_param1...buffer :the buffer that received the signalposition :the position the text was inserted atchars :the text that was insertedn_chars :the number of characters that were inserteduser_param1 :the first user parameter (if any) specified with the connect() method... :additional user parameters (if any)The "activate" signal is emitted after text is inserted into the buffer.