gi-gtk-3.0.11: Gtk bindings

CopyrightWill Thompson, Iñaki García Etxebarria and Jonas Platte
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria (garetxe@gmail.com)
Safe HaskellNone
LanguageHaskell2010

GI.Gtk.Objects.EntryBuffer

Contents

Description

The EntryBuffer class contains the actual text displayed in a Entry widget.

A single EntryBuffer object can be shared by multiple Entry widgets which will then share the same text content, but not the cursor position, visibility attributes, icon etc.

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.

Synopsis

Exported types

Methods

deleteText

entryBufferDeleteText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Word32

position: position at which to delete text

-> Int32

nChars: number of characters to delete

-> m Word32

Returns: The number of characters deleted.

Deletes a sequence of characters from the buffer. nChars characters are deleted starting at position. If nChars is negative, then all characters until the end of the text are deleted.

If position or nChars are out of bounds, then they are coerced to sane values.

Note that the positions are specified in characters, not bytes.

Since: 2.18

emitDeletedText

entryBufferEmitDeletedText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Word32

position: position at which text was deleted

-> Word32

nChars: number of characters deleted

-> m () 

Used when subclassing EntryBuffer

Since: 2.18

emitInsertedText

entryBufferEmitInsertedText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Word32

position: position at which text was inserted

-> Text

chars: text that was inserted

-> Word32

nChars: number of characters inserted

-> m () 

Used when subclassing EntryBuffer

Since: 2.18

getBytes

entryBufferGetBytes Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> m Word64

Returns: The byte length of the buffer.

Retrieves the length in bytes of the buffer. See entryBufferGetLength.

Since: 2.18

getLength

entryBufferGetLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> m Word32

Returns: The number of characters in the buffer.

Retrieves the length in characters of the buffer.

Since: 2.18

getMaxLength

entryBufferGetMaxLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> m Int32

Returns: the maximum allowed number of characters in EntryBuffer, or 0 if there is no maximum.

Retrieves the maximum allowed length of the text in buffer. See entryBufferSetMaxLength.

Since: 2.18

getText

entryBufferGetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> m 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.

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.

Since: 2.18

insertText

entryBufferInsertText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Word32

position: the position at which to insert text.

-> Text

chars: the text to insert into the buffer.

-> Int32

nChars: the length of the text in characters, or -1

-> m Word32

Returns: The number of characters actually inserted.

Inserts nChars characters of chars into the contents of the buffer, at position position.

If nChars is negative, then characters from chars will be inserted until a null-terminator is found. If position or nChars 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.

Since: 2.18

new

entryBufferNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> Maybe Text

initialChars: initial buffer text, or Nothing

-> Int32

nInitialChars: number of characters in initialChars, or -1

-> m EntryBuffer

Returns: A new GtkEntryBuffer object.

Create a new GtkEntryBuffer object.

Optionally, specify initial text to set in the buffer.

Since: 2.18

setMaxLength

entryBufferSetMaxLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Int32

maxLength: 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.

-> m () 

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.

Since: 2.18

setText

entryBufferSetText Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) 
=> a

buffer: a EntryBuffer

-> Text

chars: the new text

-> Int32

nChars: the number of characters in text, or -1

-> m () 

Sets the text in the buffer.

This is roughly equivalent to calling entryBufferDeleteText and entryBufferInsertText.

Note that nChars is in characters, not in bytes.

Since: 2.18

Properties

length

data EntryBufferLengthPropertyInfo Source #

Instances

AttrInfo EntryBufferLengthPropertyInfo Source # 
type AttrOrigin EntryBufferLengthPropertyInfo Source # 
type AttrLabel EntryBufferLengthPropertyInfo Source # 
type AttrGetType EntryBufferLengthPropertyInfo Source # 
type AttrBaseTypeConstraint EntryBufferLengthPropertyInfo Source # 
type AttrSetTypeConstraint EntryBufferLengthPropertyInfo Source # 
type AttrAllowedOps EntryBufferLengthPropertyInfo Source # 

maxLength

data EntryBufferMaxLengthPropertyInfo Source #

Instances

AttrInfo EntryBufferMaxLengthPropertyInfo Source # 
type AttrOrigin EntryBufferMaxLengthPropertyInfo Source # 
type AttrLabel EntryBufferMaxLengthPropertyInfo Source # 
type AttrGetType EntryBufferMaxLengthPropertyInfo Source # 
type AttrBaseTypeConstraint EntryBufferMaxLengthPropertyInfo Source # 
type AttrSetTypeConstraint EntryBufferMaxLengthPropertyInfo Source # 
type AttrAllowedOps EntryBufferMaxLengthPropertyInfo Source # 

text

data EntryBufferTextPropertyInfo Source #

Instances

AttrInfo EntryBufferTextPropertyInfo Source # 
type AttrOrigin EntryBufferTextPropertyInfo Source # 
type AttrLabel EntryBufferTextPropertyInfo Source # 
type AttrGetType EntryBufferTextPropertyInfo Source # 
type AttrBaseTypeConstraint EntryBufferTextPropertyInfo Source # 
type AttrSetTypeConstraint EntryBufferTextPropertyInfo Source # 
type AttrAllowedOps EntryBufferTextPropertyInfo Source # 

Signals

deletedText

insertedText