gi-gtk4-4.0.12: Gtk 4.x bindings

Copyright | Will Thompson and Iñaki García Etxebarria
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria
Safe Haskell | None
Language | Haskell2010

GI.Gtk.Objects.Text

Contents

- Exported types
- Methods
  - computeCursorExtents
  - getActivatesDefault
  - getAttributes
  - getBuffer
  - getEnableEmojiCompletion
  - getExtraMenu
  - getInputHints
  - getInputPurpose
  - getInvisibleChar
  - getMaxLength
  - getOverwriteMode
  - getPlaceholderText
  - getPropagateTextWidth
  - getTabs
  - getTextLength
  - getTruncateMultiline
  - getVisibility
  - grabFocusWithoutSelecting
  - new
  - newWithBuffer
  - setActivatesDefault
  - setAttributes
  - setBuffer
  - setEnableEmojiCompletion
  - setExtraMenu
  - setInputHints
  - setInputPurpose
  - setInvisibleChar
  - setMaxLength
  - setOverwriteMode
  - setPlaceholderText
  - setPropagateTextWidth
  - setTabs
  - setTruncateMultiline
  - setVisibility
  - unsetInvisibleChar
- Properties
  - activatesDefault
  - attributes
  - buffer
  - enableEmojiCompletion
  - extraMenu
  - imModule
  - inputHints
  - inputPurpose
  - invisibleChar
  - invisibleCharSet
  - maxLength
  - overwriteMode
  - placeholderText
  - propagateTextWidth
  - scrollOffset
  - tabs
  - truncateMultiline
  - visibility
- Signals
  - activate
  - backspace
  - copyClipboard
  - cutClipboard
  - deleteFromCursor
  - insertAtCursor
  - insertEmoji
  - moveCursor
  - pasteClipboard
  - preeditChanged
  - toggleOverwrite

Description

A single-line text entry.

`GtkText` is the common implementation of single-line text editing that is shared between `Entry`, `PasswordEntry`, `SpinButton`, and other widgets. In all of these, a `GtkText` instance is used as the delegate for the `Editable` implementation.

A large number of key bindings s supported by default. If the entered text is longer than the allocation of the widget, the widget will scroll so that the cursor position is visible.

When using an entry for passwords and other sensitive information, it can be put into “password mode” using `textSetVisibility`. In this mode, entered text is displayed using an “invisible” character. By default, GTK picks the best invisible character that is available in the current font, but it can be changed with `textSetInvisibleChar`.

If you want to add icons or progress display in an entry, look at `Entry`. There are other alternatives for more specialized use cases, such as `SearchEntry`.

If you need multi-line editable text, use `TextView`.

# Shortcuts and Gestures

`GtkText` supports the following keyboard shortcuts:

- <kbd>Shift</kbd>+<kbd>F10</kbd> or <kbd>Menu</kbd> opens the context menu.
- <kbd>Ctrl</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>&sol;</kbd> selects all the text.
- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>A</kbd> or <kbd>Ctrl</kbd>+<kbd>&bsol;</kbd> unselects all.
- <kbd>Ctrl</kbd>+<kbd>Z</kbd> undoes the last modification.
- <kbd>Ctrl</kbd>+<kbd>Y</kbd> or <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>Z</kbd> redoes the last undone modification.
- <kbd>Ctrl</kbd>+<kbd>Shift</kbd>+<kbd>T</kbd> toggles the text direction.
- <kbd>Clear</kbd> clears the content.

Additionally, the following signals have default keybindings:

- Text::activate
- Text::backspace
- Text::copyClipboard
- Text::cutClipboard
- Text::deleteFromCursor
- Text::insertEmoji
- Text::moveCursor
- Text::pasteClipboard
- Text::toggleOverwrite

# Actions

`GtkText` defines a set of built-in actions:

- `clipboard.copy` copies the contents to the clipboard.
- `clipboard.cut` copies the contents to the clipboard and deletes it from the widget.
- `clipboard.paste` inserts the contents of the clipboard into the widget.
- `menu.popup` opens the context menu.
- `misc.insert-emoji` opens the Emoji chooser.
- `misc.toggle-visibility` toggles the `GtkText`:visibility property.
- `misc.toggle-direction` toggles the text direction.
- `selection.delete` deletes the current selection.
- `selection.select-all` selects all of the widgets content.
- `text.redo` redoes the last change to the contents.
- `text.undo` undoes the last change to the contents.
- `text.clear` removes all content.

# CSS nodes

    text[.read-only]
    ├── placeholder
    ├── undershoot.left
    ├── undershoot.right
    ├── [selection]
    ├── [cursor-handle[.top]
    ├── [cursor-handle.bottom]
    ├── [block-cursor]
    ├── [cursor-handle[.top/.bottom][.insertion-cursor]]
    ╰── [window.popup]

`GtkText` has a main node with the name `text`. Depending on the properties of the widget, the `.read-only` style class may appear.

When the entry has a selection, it adds a subnode with the name `selection`.

When the entry is in overwrite mode, it adds a subnode with the name `block-cursor` that determines how the block cursor is drawn.

The CSS node for a context menu is added as a subnode with the name `popup`.

The `undershoot` nodes are used to draw the underflow indication when content is scrolled out of view. These nodes get the `.left` or `.right` style class added depending on where the indication is drawn.

When touch is used and touch selection handles are shown, they are using CSS nodes with name `cursor-handle`. They get the `.top` or `.bottom` style class depending on where they are shown in relation to the selection. If there is just a single handle for the text cursor, it gets the style class `.insertion-cursor`.

# Accessibility

`GtkText` uses the `AccessibleRoleNone` role, which causes it to be skipped for accessibility. This is because `GtkText` is expected to be used as a delegate for a `GtkEditable` implementation that will be represented to accessibility.

Synopsis

- newtype Text = Text (ManagedPtr Text)
- class (GObject o, IsDescendantOf Text o) => IsText o
- toText :: (MonadIO m, IsText o) => o -> m Text
- textComputeCursorExtents :: (HasCallStack, MonadIO m, IsText a) => a -> CSize -> m (Rect, Rect)
- textGetActivatesDefault :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGetAttributes :: (HasCallStack, MonadIO m, IsText a) => a -> m (Maybe AttrList)
- textGetBuffer :: (HasCallStack, MonadIO m, IsText a) => a -> m EntryBuffer
- textGetEnableEmojiCompletion :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGetExtraMenu :: (HasCallStack, MonadIO m, IsText a) => a -> m (Maybe MenuModel)
- textGetInputHints :: (HasCallStack, MonadIO m, IsText a) => a -> m [InputHints]
- textGetInputPurpose :: (HasCallStack, MonadIO m, IsText a) => a -> m InputPurpose
- textGetInvisibleChar :: (HasCallStack, MonadIO m, IsText a) => a -> m Char
- textGetMaxLength :: (HasCallStack, MonadIO m, IsText a) => a -> m Int32
- textGetOverwriteMode :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGetPlaceholderText :: (HasCallStack, MonadIO m, IsText a) => a -> m (Maybe Text)
- textGetPropagateTextWidth :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGetTabs :: (HasCallStack, MonadIO m, IsText a) => a -> m (Maybe TabArray)
- textGetTextLength :: (HasCallStack, MonadIO m, IsText a) => a -> m Word16
- textGetTruncateMultiline :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGetVisibility :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textGrabFocusWithoutSelecting :: (HasCallStack, MonadIO m, IsText a) => a -> m Bool
- textNew :: (HasCallStack, MonadIO m) => m Text
- textNewWithBuffer :: (HasCallStack, MonadIO m, IsEntryBuffer a) => a -> m Text
- textSetActivatesDefault :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textSetAttributes :: (HasCallStack, MonadIO m, IsText a) => a -> Maybe AttrList -> m ()
- textSetBuffer :: (HasCallStack, MonadIO m, IsText a, IsEntryBuffer b) => a -> b -> m ()
- textSetEnableEmojiCompletion :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textSetExtraMenu :: (HasCallStack, MonadIO m, IsText a, IsMenuModel b) => a -> Maybe b -> m ()
- textSetInputHints :: (HasCallStack, MonadIO m, IsText a) => a -> [InputHints] -> m ()
- textSetInputPurpose :: (HasCallStack, MonadIO m, IsText a) => a -> InputPurpose -> m ()
- textSetInvisibleChar :: (HasCallStack, MonadIO m, IsText a) => a -> Char -> m ()
- textSetMaxLength :: (HasCallStack, MonadIO m, IsText a) => a -> Int32 -> m ()
- textSetOverwriteMode :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textSetPlaceholderText :: (HasCallStack, MonadIO m, IsText a) => a -> Maybe Text -> m ()
- textSetPropagateTextWidth :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textSetTabs :: (HasCallStack, MonadIO m, IsText a) => a -> Maybe TabArray -> m ()
- textSetTruncateMultiline :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textSetVisibility :: (HasCallStack, MonadIO m, IsText a) => a -> Bool -> m ()
- textUnsetInvisibleChar :: (HasCallStack, MonadIO m, IsText a) => a -> m ()
- constructTextActivatesDefault :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextActivatesDefault :: (MonadIO m, IsText o) => o -> m Bool
- setTextActivatesDefault :: (MonadIO m, IsText o) => o -> Bool -> m ()
- clearTextAttributes :: (MonadIO m, IsText o) => o -> m ()
- constructTextAttributes :: (IsText o, MonadIO m) => AttrList -> m (GValueConstruct o)
- getTextAttributes :: (MonadIO m, IsText o) => o -> m (Maybe AttrList)
- setTextAttributes :: (MonadIO m, IsText o) => o -> AttrList -> m ()
- constructTextBuffer :: (IsText o, MonadIO m, IsEntryBuffer a) => a -> m (GValueConstruct o)
- getTextBuffer :: (MonadIO m, IsText o) => o -> m EntryBuffer
- setTextBuffer :: (MonadIO m, IsText o, IsEntryBuffer a) => o -> a -> m ()
- constructTextEnableEmojiCompletion :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextEnableEmojiCompletion :: (MonadIO m, IsText o) => o -> m Bool
- setTextEnableEmojiCompletion :: (MonadIO m, IsText o) => o -> Bool -> m ()
- clearTextExtraMenu :: (MonadIO m, IsText o) => o -> m ()
- constructTextExtraMenu :: (IsText o, MonadIO m, IsMenuModel a) => a -> m (GValueConstruct o)
- getTextExtraMenu :: (MonadIO m, IsText o) => o -> m (Maybe MenuModel)
- setTextExtraMenu :: (MonadIO m, IsText o, IsMenuModel a) => o -> a -> m ()
- clearTextImModule :: (MonadIO m, IsText o) => o -> m ()
- constructTextImModule :: (IsText o, MonadIO m) => Text -> m (GValueConstruct o)
- getTextImModule :: (MonadIO m, IsText o) => o -> m (Maybe Text)
- setTextImModule :: (MonadIO m, IsText o) => o -> Text -> m ()
- constructTextInputHints :: (IsText o, MonadIO m) => [InputHints] -> m (GValueConstruct o)
- getTextInputHints :: (MonadIO m, IsText o) => o -> m [InputHints]
- setTextInputHints :: (MonadIO m, IsText o) => o -> [InputHints] -> m ()
- constructTextInputPurpose :: (IsText o, MonadIO m) => InputPurpose -> m (GValueConstruct o)
- getTextInputPurpose :: (MonadIO m, IsText o) => o -> m InputPurpose
- setTextInputPurpose :: (MonadIO m, IsText o) => o -> InputPurpose -> m ()
- constructTextInvisibleChar :: (IsText o, MonadIO m) => Word32 -> m (GValueConstruct o)
- getTextInvisibleChar :: (MonadIO m, IsText o) => o -> m Word32
- setTextInvisibleChar :: (MonadIO m, IsText o) => o -> Word32 -> m ()
- constructTextInvisibleCharSet :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextInvisibleCharSet :: (MonadIO m, IsText o) => o -> m Bool
- setTextInvisibleCharSet :: (MonadIO m, IsText o) => o -> Bool -> m ()
- constructTextMaxLength :: (IsText o, MonadIO m) => Int32 -> m (GValueConstruct o)
- getTextMaxLength :: (MonadIO m, IsText o) => o -> m Int32
- setTextMaxLength :: (MonadIO m, IsText o) => o -> Int32 -> m ()
- constructTextOverwriteMode :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextOverwriteMode :: (MonadIO m, IsText o) => o -> m Bool
- setTextOverwriteMode :: (MonadIO m, IsText o) => o -> Bool -> m ()
- clearTextPlaceholderText :: (MonadIO m, IsText o) => o -> m ()
- constructTextPlaceholderText :: (IsText o, MonadIO m) => Text -> m (GValueConstruct o)
- getTextPlaceholderText :: (MonadIO m, IsText o) => o -> m (Maybe Text)
- setTextPlaceholderText :: (MonadIO m, IsText o) => o -> Text -> m ()
- constructTextPropagateTextWidth :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextPropagateTextWidth :: (MonadIO m, IsText o) => o -> m Bool
- setTextPropagateTextWidth :: (MonadIO m, IsText o) => o -> Bool -> m ()
- getTextScrollOffset :: (MonadIO m, IsText o) => o -> m Int32
- clearTextTabs :: (MonadIO m, IsText o) => o -> m ()
- constructTextTabs :: (IsText o, MonadIO m) => TabArray -> m (GValueConstruct o)
- getTextTabs :: (MonadIO m, IsText o) => o -> m (Maybe TabArray)
- setTextTabs :: (MonadIO m, IsText o) => o -> TabArray -> m ()
- constructTextTruncateMultiline :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextTruncateMultiline :: (MonadIO m, IsText o) => o -> m Bool
- setTextTruncateMultiline :: (MonadIO m, IsText o) => o -> Bool -> m ()
- constructTextVisibility :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o)
- getTextVisibility :: (MonadIO m, IsText o) => o -> m Bool
- setTextVisibility :: (MonadIO m, IsText o) => o -> Bool -> m ()
- type TextActivateCallback = IO ()
- afterTextActivate :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextActivateCallback) -> m SignalHandlerId
- onTextActivate :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextActivateCallback) -> m SignalHandlerId
- type TextBackspaceCallback = IO ()
- afterTextBackspace :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextBackspaceCallback) -> m SignalHandlerId
- onTextBackspace :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextBackspaceCallback) -> m SignalHandlerId
- type TextCopyClipboardCallback = IO ()
- afterTextCopyClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCopyClipboardCallback) -> m SignalHandlerId
- onTextCopyClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCopyClipboardCallback) -> m SignalHandlerId
- type TextCutClipboardCallback = IO ()
- afterTextCutClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCutClipboardCallback) -> m SignalHandlerId
- onTextCutClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCutClipboardCallback) -> m SignalHandlerId
- type TextDeleteFromCursorCallback = DeleteType -> Int32 -> IO ()
- afterTextDeleteFromCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextDeleteFromCursorCallback) -> m SignalHandlerId
- onTextDeleteFromCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextDeleteFromCursorCallback) -> m SignalHandlerId
- type TextInsertAtCursorCallback = Text -> IO ()
- afterTextInsertAtCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertAtCursorCallback) -> m SignalHandlerId
- onTextInsertAtCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertAtCursorCallback) -> m SignalHandlerId
- type TextInsertEmojiCallback = IO ()
- afterTextInsertEmoji :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertEmojiCallback) -> m SignalHandlerId
- onTextInsertEmoji :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertEmojiCallback) -> m SignalHandlerId
- type TextMoveCursorCallback = MovementStep -> Int32 -> Bool -> IO ()
- afterTextMoveCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextMoveCursorCallback) -> m SignalHandlerId
- onTextMoveCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextMoveCursorCallback) -> m SignalHandlerId
- type TextPasteClipboardCallback = IO ()
- afterTextPasteClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPasteClipboardCallback) -> m SignalHandlerId
- onTextPasteClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPasteClipboardCallback) -> m SignalHandlerId
- type TextPreeditChangedCallback = Text -> IO ()
- afterTextPreeditChanged :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPreeditChangedCallback) -> m SignalHandlerId
- onTextPreeditChanged :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPreeditChangedCallback) -> m SignalHandlerId
- type TextToggleOverwriteCallback = IO ()
- afterTextToggleOverwrite :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextToggleOverwriteCallback) -> m SignalHandlerId
- onTextToggleOverwrite :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextToggleOverwriteCallback) -> m SignalHandlerId

# Exported types

newtype Text Source #

Memory-managed wrapper type.

Constructors

Text (ManagedPtr Text) |

#### Instances

Instances details

Eq Text Source # |
Instance details Defined in GI.Gtk.Objects.Text Methods (==) :: Text -> Text -> Bool Source # (/=) :: Text -> Text -> Bool Source #
GObject Text Source # |
Instance details Defined in GI.Gtk.Objects.Text
ManagedPtrNewtype Text Source # |
Instance details Defined in GI.Gtk.Objects.Text Methods toManagedPtr :: Text -> ManagedPtr Text Source #
TypedObject Text Source # |
Instance details Defined in GI.Gtk.Objects.Text Methods glibType :: IO GType Source #
HasParentTypes Text Source # |
Instance details Defined in GI.Gtk.Objects.Text
IsGValue (Maybe Text) Source # | Convert `Text` to and from `GValue`. See `toGValue` and `fromGValue`.
Instance details Defined in GI.Gtk.Objects.Text Methods gvalueGType_ :: IO GType Source # gvalueSet_ :: Ptr GValue -> Maybe Text -> IO () Source # gvalueGet_ :: Ptr GValue -> IO (Maybe Text) Source #
type ParentTypes Text Source # |
Instance details Defined in GI.Gtk.Objects.Text type ParentTypes Text = '[Widget, Object, Accessible, AccessibleText, Buildable, ConstraintTarget, Editable]

class (GObject o, IsDescendantOf Text o) => IsText o Source #

Type class for types which can be safely cast to `Text`, for instance with `toText`.

#### Instances

Instances details

(GObject o, IsDescendantOf Text o) => IsText o Source # |
Instance details Defined in GI.Gtk.Objects.Text

toText :: (MonadIO m, IsText o) => o -> m Text Source #

Cast to `Text`, for types for which this is known to be safe. For general casts, use `castTo`.

# Methods

### Click to display all available methods, including inherited ones

Expand

#### Methods

actionSetEnabled, activate, activateAction, activateDefault, addController, addCssClass, addMnemonicLabel, addTickCallback, allocate, announce, bindProperty, bindPropertyFull, childFocus, computeBounds, computeCursorExtents, computeExpand, computePoint, computeTransform, contains, createPangoContext, createPangoLayout, delegateGetAccessiblePlatformState, deleteSelection, deleteText, disposeTemplate, dragCheckThreshold, errorBell, finishDelegate, forceFloating, freezeNotify, getv, grabFocus, grabFocusWithoutSelecting, hasCssClass, hasDefault, hasFocus, hasVisibleFocus, hide, inDestruction, initDelegate, initTemplate, insertActionGroup, insertAfter, insertBefore, insertText, isAncestor, isDrawable, isFloating, isFocus, isSensitive, isVisible, keynavFailed, listMnemonicLabels, map, measure, mnemonicActivate, notify, notifyByPspec, observeChildren, observeControllers, pick, queueAllocate, queueDraw, queueResize, realize, ref, refSink, removeController, removeCssClass, removeMnemonicLabel, removeTickCallback, resetProperty, resetRelation, resetState, runDispose, selectRegion, shouldLayout, show, sizeAllocate, snapshotChild, stealData, stealQdata, thawNotify, translateCoordinates, triggerTooltipQuery, unmap, unparent, unrealize, unref, unsetInvisibleChar, unsetStateFlags, updateCaretPosition, updateContents, updateNextAccessibleSibling, updatePlatformState, updateProperty, updateRelation, updateSelectionBound, updateState, watchClosure.

#### Getters

getAccessibleId, getAccessibleParent, getAccessibleRole, getActivatesDefault, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getAttributes, getBaseline, getBounds, getBuffer, getBuildableId, getCanFocus, getCanTarget, getChars, getChildVisible, getClipboard, getColor, getCssClasses, getCssName, getCursor, getData, getDelegate, getDirection, getDisplay, getEditable, getEnableEmojiCompletion, getEnableUndo, getExtraMenu, getFirstAccessibleChild, getFirstChild, getFocusChild, getFocusOnClick, getFocusable, getFontMap, getFontOptions, getFrameClock, getHalign, getHasTooltip, getHeight, getHexpand, getHexpandSet, getInputHints, getInputPurpose, getInvisibleChar, getLastChild, getLayoutManager, getLimitEvents, getMapped, getMarginBottom, getMarginEnd, getMarginStart, getMarginTop, getMaxLength, getMaxWidthChars, getName, getNative, getNextAccessibleSibling, getNextSibling, getOpacity, getOverflow, getOverwriteMode, getPangoContext, getParent, getPlaceholderText, getPlatformState, getPosition, getPreferredSize, getPrevSibling, getPrimaryClipboard, getPropagateTextWidth, getProperty, getQdata, getRealized, getReceivesDefault, getRequestMode, getRoot, getScaleFactor, getSelectionBounds, getSensitive, getSettings, getSize, getSizeRequest, getStateFlags, getStyleContext, getTabs, getTemplateChild, getText, getTextLength, getTooltipMarkup, getTooltipText, getTruncateMultiline, getValign, getVexpand, getVexpandSet, getVisibility, getVisible, getWidth, getWidthChars.

#### Setters

setAccessibleParent, setActivatesDefault, setAlignment, setAttributes, setBuffer, setCanFocus, setCanTarget, setChildVisible, setCssClasses, setCursor, setCursorFromName, setData, setDataFull, setDirection, setEditable, setEnableEmojiCompletion, setEnableUndo, setExtraMenu, setFocusChild, setFocusOnClick, setFocusable, setFontMap, setFontOptions, setHalign, setHasTooltip, setHexpand, setHexpandSet, setInputHints, setInputPurpose, setInvisibleChar, setLayoutManager, setLimitEvents, setMarginBottom, setMarginEnd, setMarginStart, setMarginTop, setMaxLength, setMaxWidthChars, setName, setOpacity, setOverflow, setOverwriteMode, setParent, setPlaceholderText, setPosition, setPropagateTextWidth, setProperty, setReceivesDefault, setSensitive, setSizeRequest, setStateFlags, setTabs, setText, setTooltipMarkup, setTooltipText, setTruncateMultiline, setValign, setVexpand, setVexpandSet, setVisibility, setVisible, setWidthChars.

## computeCursorExtents

textComputeCursorExtents Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> CSize | `position`: the character position
-> m (Rect, Rect) |

Determines the positions of the strong and weak cursors for a given character position.

The position of each cursor is stored as a zero-width rectangle. The strong cursor location is the location where characters of the directionality equal to the base direction are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction are inserted.

The rectangle positions are in widget coordinates.

Since: 4.4

## getActivatesDefault

textGetActivatesDefault Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if `self` will activate the default widget

Returns whether pressing <kbd>Enter</kbd> will activate the default widget for the window containing the widget.

See `textSetActivatesDefault`.

## getAttributes

textGetAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m (Maybe AttrList) | Returns: the attribute list

Gets the attribute list that was set on the text widget.

See `textSetAttributes`.

## getBuffer

textGetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m EntryBuffer | Returns: the entry buffer object

Get the entry buffer object which holds the text for this widget.

## getEnableEmojiCompletion

textGetEnableEmojiCompletion Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if Emoji completion is enabled

Returns whether Emoji completion is enabled.

## getExtraMenu

textGetExtraMenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m (Maybe MenuModel) | Returns: the menu model

Gets the extra menu model of the text widget.

See `textSetExtraMenu`.

## getInputHints

textGetInputHints Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m [InputHints] | Returns: the input hints

Gets the input hints of the text widget.

## getInputPurpose

textGetInputPurpose Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m InputPurpose | Returns: the input purpose

Gets the input purpose of the text widget.

## getInvisibleChar

textGetInvisibleChar Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Char | Returns: the current invisible char, or 0, if `text` does not show invisible text at all

Retrieves the character displayed when visibility is set to false.

Note that GTK does not compute this value unless it needs it, so the value returned by this function is not very useful unless it has been explicitly set with `textSetInvisibleChar`.

## getMaxLength

textGetMaxLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Int32 | Returns: the maximum allowed number of characters, or 0 if there is no limit

Retrieves the maximum allowed length of the contents.

See `textSetMaxLength`.

This is equivalent to getting `self`'s `GtkEntryBuffer` and calling `entryBufferGetMaxLength` on it.

## getOverwriteMode

textGetOverwriteMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: whether text is overwritten when typing

Gets whether text is overwritten when typing.

See `textSetOverwriteMode`.

## getPlaceholderText

textGetPlaceholderText Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m (Maybe Text) | Returns: the placeholder text

Retrieves the text that will be displayed when the text widget is empty and unfocused

See `textSetPlaceholderText`.

## getPropagateTextWidth

textGetPropagateTextWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if `self` will propagate the text width

Returns whether the text widget will grow and shrink with the content.

## getTabs

textGetTabs Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m (Maybe TabArray) | Returns: the tab stops

Gets the tab stops for the text widget.

See `textSetTabs`.

## getTextLength

textGetTextLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Word16 | Returns: the length of the contents, in characters

Retrieves the length of the contents.

This is equivalent to getting `self`'s `GtkEntryBuffer` and calling `entryBufferGetLength` on it.

## getTruncateMultiline

textGetTruncateMultiline Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if `self` will truncate pasted multi-line text

Returns whether pasted text will be truncated to the first line.

## getVisibility

textGetVisibility Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if the text is visible

Retrieves whether the text is visible.

## grabFocusWithoutSelecting

textGrabFocusWithoutSelecting Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m Bool | Returns: true if focus is now inside `self`

Causes the text widget to have the keyboard focus.

It behaves like `widgetGrabFocus`, except that it does not select the contents of `self`.

You only want to call this on some special entries which the user usually doesn't want to replace all text in, such as search-as-you-type entries.

## new

textNew Source #

Arguments

:: (HasCallStack, MonadIO m) |
=> m Text | Returns: the new `GtkText`

Creates a new `GtkText`.

## newWithBuffer

textNewWithBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsEntryBuffer a) |
=> a | `buffer`: the buffer to use
-> m Text | Returns: a new `GtkText`

Creates a new `GtkText` with the specified buffer.

## setActivatesDefault

textSetActivatesDefault Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `activates`: true to activate window’s default widget on <kbd>Enter</kbd> keypress
-> m () |

Sets whether pressing <kbd>Enter</kbd> will activate the default widget.

This usually means that the dialog containing `self` will be closed, since the default widget is usually one of the dialog buttons.

## setAttributes

textSetAttributes Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Maybe AttrList | `attrs`: a list of style attributes
-> m () |

Apply attributes to the contents of the text widget.

## setBuffer

textSetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a, IsEntryBuffer b) |
=> a | `self`: a text widget
-> b | `buffer`: an entry buffer object
-> m () |

Set the entry buffer object which holds the text for this widget.

## setEnableEmojiCompletion

textSetEnableEmojiCompletion Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `enableEmojiCompletion`: true to enable Emoji completion
-> m () |

Sets whether Emoji completion is enabled.

If it is, typing ':', followed by a recognized keyword, will pop up a window with suggested Emojis matching the keyword.

## setExtraMenu

textSetExtraMenu Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a, IsMenuModel b) |
=> a | `self`: a text widget
-> Maybe b | `model`: a menu model
-> m () |

Sets a menu model to add to the context menu of the text widget.

## setInputHints

textSetInputHints Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> [InputHints] | `hints`: input hints
-> m () |

Sets hints that allow input methods to fine-tune their behaviour.

## setInputPurpose

textSetInputPurpose Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> InputPurpose | `purpose`: the input purpose
-> m () |

Sets the input purpose of the text widget.

The input purpose can be used by on-screen keyboards and other input methods to adjust their behaviour.

## setInvisibleChar

textSetInvisibleChar Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Char | `ch`: a Unicode character
-> m () |

Sets the character to use when in “password mode”.

By default, GTK picks the best invisible char available in the current font. If you set the invisible char to 0, then the user will get no feedback at all; there will be no text on the screen as they type.

## setMaxLength

textSetMaxLength Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Int32 | `length`: the maximum length of the text, 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.

If the current contents are longer than the given length, they will be truncated to fit.

This is equivalent to getting `self`'s `GtkEntryBuffer` and calling `entryBufferSetMaxLength` on it.

## setOverwriteMode

textSetOverwriteMode Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `overwrite`: new value
-> m () |

Sets whether the text is overwritten when typing.

## setPlaceholderText

textSetPlaceholderText Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Maybe Text | `text`: a string to be displayed when `self` is empty and unfocused
-> m () |

Sets the text to be displayed when the text widget is empty and unfocused.

This can be used to give a visual hint of the expected contents of the text widget.

## setPropagateTextWidth

textSetPropagateTextWidth Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `propagateTextWidth`: true to propagate the text width
-> m () |

Sets whether the text widget should grow and shrink with the content.

## setTabs

textSetTabs Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Maybe TabArray | `tabs`: tab stops
-> m () |

Sets tab stops for the text widget.

## setTruncateMultiline

textSetTruncateMultiline Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `truncateMultiline`: true to truncate multi-line text
-> m () |

Sets whether pasted text should be truncated to the first line.

## setVisibility

textSetVisibility Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> Bool | `visible`: true if the contents of the text widget are displayed as plain text
-> m () |

Sets whether the contents of the text widget are visible or not.

When visibility is set to false, characters are displayed as the invisible char, and it will also appear that way when the text in the widget is copied to the clipboard.

By default, GTK picks the best invisible character available in the current font, but it can be changed with `textSetInvisibleChar`.

Note that you probably want to set Text:inputPurpose to `InputPurposePassword` or `InputPurposePin` to inform input methods about the purpose of this widget, in addition to setting visibility to false.

## unsetInvisibleChar

textUnsetInvisibleChar Source #

Arguments

:: (HasCallStack, MonadIO m, IsText a) |
=> a | `self`: a text widget
-> m () |

Unsets the invisible char.

After calling this, the default invisible char is used again.

# Properties

## activatesDefault

Whether to activate the default widget when <kbd>Enter</kbd> is pressed.

constructTextActivatesDefault :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`activates-default`” property. This is rarely needed directly, but it is used by `new`.

getTextActivatesDefault :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`activates-default`” property. When overloading is enabled, this is equivalent to

    get text #activatesDefault

setTextActivatesDefault :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`activates-default`” property. When overloading is enabled, this is equivalent to

    set text [ #activatesDefault := value ]

## attributes

A list of Pango attributes to apply to the text.

This is mainly useful to change the size or weight of the text.

The `PangoAttribute`'s `startIndex` and `endIndex` must refer to the `GtkEntryBuffer` text, i.e. without the preedit string.

clearTextAttributes :: (MonadIO m, IsText o) => o -> m () Source #

Set the value of the “`attributes`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #attributes

constructTextAttributes :: (IsText o, MonadIO m) => AttrList -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`attributes`” property. This is rarely needed directly, but it is used by `new`.

getTextAttributes :: (MonadIO m, IsText o) => o -> m (Maybe AttrList) Source #

Get the value of the “`attributes`” property. When overloading is enabled, this is equivalent to

    get text #attributes

setTextAttributes :: (MonadIO m, IsText o) => o -> AttrList -> m () Source #

Set the value of the “`attributes`” property. When overloading is enabled, this is equivalent to

    set text [ #attributes := value ]

## buffer

The `GtkEntryBuffer` object which stores the text.

constructTextBuffer :: (IsText o, MonadIO m, IsEntryBuffer a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`buffer`” property. This is rarely needed directly, but it is used by `new`.

getTextBuffer :: (MonadIO m, IsText o) => o -> m EntryBuffer Source #

Get the value of the “`buffer`” property. When overloading is enabled, this is equivalent to

    get text #buffer

setTextBuffer :: (MonadIO m, IsText o, IsEntryBuffer a) => o -> a -> m () Source #

Set the value of the “`buffer`” property. When overloading is enabled, this is equivalent to

    set text [ #buffer := value ]

## enableEmojiCompletion

Whether to suggest Emoji replacements.

constructTextEnableEmojiCompletion :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`enable-emoji-completion`” property. This is rarely needed directly, but it is used by `new`.

getTextEnableEmojiCompletion :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`enable-emoji-completion`” property. When overloading is enabled, this is equivalent to

    get text #enableEmojiCompletion

setTextEnableEmojiCompletion :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`enable-emoji-completion`” property. When overloading is enabled, this is equivalent to

    set text [ #enableEmojiCompletion := value ]

## extraMenu

A menu model whose contents will be appended to the context menu.

clearTextExtraMenu :: (MonadIO m, IsText o) => o -> m () Source #

Set the value of the “`extra-menu`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #extraMenu

constructTextExtraMenu :: (IsText o, MonadIO m, IsMenuModel a) => a -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`extra-menu`” property. This is rarely needed directly, but it is used by `new`.

getTextExtraMenu :: (MonadIO m, IsText o) => o -> m (Maybe MenuModel) Source #

Get the value of the “`extra-menu`” property. When overloading is enabled, this is equivalent to

    get text #extraMenu

setTextExtraMenu :: (MonadIO m, IsText o, IsMenuModel a) => o -> a -> m () Source #

Set the value of the “`extra-menu`” property. When overloading is enabled, this is equivalent to

    set text [ #extraMenu := value ]

## imModule

Which input method module should be used.

See `IMMulticontext`.

Setting this to a non-`NULL` value overrides the system-wide input method. See the Settings:gtkImModule setting.

clearTextImModule :: (MonadIO m, IsText o) => o -> m () Source #

Set the value of the “`im-module`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #imModule

constructTextImModule :: (IsText o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`im-module`” property. This is rarely needed directly, but it is used by `new`.

getTextImModule :: (MonadIO m, IsText o) => o -> m (Maybe Text) Source #

Get the value of the “`im-module`” property. When overloading is enabled, this is equivalent to

    get text #imModule

setTextImModule :: (MonadIO m, IsText o) => o -> Text -> m () Source #

Set the value of the “`im-module`” property. When overloading is enabled, this is equivalent to

    set text [ #imModule := value ]

## inputHints

Additional hints that allow input methods to fine-tune their behaviour.

constructTextInputHints :: (IsText o, MonadIO m) => [InputHints] -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`input-hints`” property. This is rarely needed directly, but it is used by `new`.

getTextInputHints :: (MonadIO m, IsText o) => o -> m [InputHints] Source #

Get the value of the “`input-hints`” property. When overloading is enabled, this is equivalent to

    get text #inputHints

setTextInputHints :: (MonadIO m, IsText o) => o -> [InputHints] -> m () Source #

Set the value of the “`input-hints`” property. When overloading is enabled, this is equivalent to

    set text [ #inputHints := value ]

## inputPurpose

The purpose of this text field.

This information can be used by on-screen keyboards and other input methods to adjust their behaviour.

Note that setting the purpose to `InputPurposePassword` or `InputPurposePin` is independent from setting Text:visibility.

constructTextInputPurpose :: (IsText o, MonadIO m) => InputPurpose -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`input-purpose`” property. This is rarely needed directly, but it is used by `new`.

getTextInputPurpose :: (MonadIO m, IsText o) => o -> m InputPurpose Source #

Get the value of the “`input-purpose`” property. When overloading is enabled, this is equivalent to

    get text #inputPurpose

setTextInputPurpose :: (MonadIO m, IsText o) => o -> InputPurpose -> m () Source #

Set the value of the “`input-purpose`” property. When overloading is enabled, this is equivalent to

    set text [ #inputPurpose := value ]

## invisibleChar

The character to used when masking contents (in “password mode”).

constructTextInvisibleChar :: (IsText o, MonadIO m) => Word32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`invisible-char`” property. This is rarely needed directly, but it is used by `new`.

getTextInvisibleChar :: (MonadIO m, IsText o) => o -> m Word32 Source #

Get the value of the “`invisible-char`” property. When overloading is enabled, this is equivalent to

    get text #invisibleChar

setTextInvisibleChar :: (MonadIO m, IsText o) => o -> Word32 -> m () Source #

Set the value of the “`invisible-char`” property. When overloading is enabled, this is equivalent to

    set text [ #invisibleChar := value ]

## invisibleCharSet

Whether the invisible char has been set.

constructTextInvisibleCharSet :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`invisible-char-set`” property. This is rarely needed directly, but it is used by `new`.

getTextInvisibleCharSet :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`invisible-char-set`” property. When overloading is enabled, this is equivalent to

    get text #invisibleCharSet

setTextInvisibleCharSet :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`invisible-char-set`” property. When overloading is enabled, this is equivalent to

    set text [ #invisibleCharSet := value ]

## maxLength

Maximum number of characters that are allowed.

Zero indicates no limit.

constructTextMaxLength :: (IsText o, MonadIO m) => Int32 -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`max-length`” property. This is rarely needed directly, but it is used by `new`.

getTextMaxLength :: (MonadIO m, IsText o) => o -> m Int32 Source #

Get the value of the “`max-length`” property. When overloading is enabled, this is equivalent to

    get text #maxLength

setTextMaxLength :: (MonadIO m, IsText o) => o -> Int32 -> m () Source #

Set the value of the “`max-length`” property. When overloading is enabled, this is equivalent to

    set text [ #maxLength := value ]

## overwriteMode

If text is overwritten when typing.

constructTextOverwriteMode :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`overwrite-mode`” property. This is rarely needed directly, but it is used by `new`.

getTextOverwriteMode :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`overwrite-mode`” property. When overloading is enabled, this is equivalent to

    get text #overwriteMode

setTextOverwriteMode :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`overwrite-mode`” property. When overloading is enabled, this is equivalent to

    set text [ #overwriteMode := value ]

## placeholderText

The text that will be displayed in the `GtkText` when it is empty and unfocused.

clearTextPlaceholderText :: (MonadIO m, IsText o) => o -> m () Source #

Set the value of the “`placeholder-text`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #placeholderText

constructTextPlaceholderText :: (IsText o, MonadIO m) => Text -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`placeholder-text`” property. This is rarely needed directly, but it is used by `new`.

getTextPlaceholderText :: (MonadIO m, IsText o) => o -> m (Maybe Text) Source #

Get the value of the “`placeholder-text`” property. When overloading is enabled, this is equivalent to

    get text #placeholderText

setTextPlaceholderText :: (MonadIO m, IsText o) => o -> Text -> m () Source #

Set the value of the “`placeholder-text`” property. When overloading is enabled, this is equivalent to

    set text [ #placeholderText := value ]

## propagateTextWidth

Whether the widget should grow and shrink with the content.

constructTextPropagateTextWidth :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`propagate-text-width`” property. This is rarely needed directly, but it is used by `new`.

getTextPropagateTextWidth :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`propagate-text-width`” property. When overloading is enabled, this is equivalent to

    get text #propagateTextWidth

setTextPropagateTextWidth :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`propagate-text-width`” property. When overloading is enabled, this is equivalent to

    set text [ #propagateTextWidth := value ]

## scrollOffset

Number of pixels scrolled of the screen to the left.

getTextScrollOffset :: (MonadIO m, IsText o) => o -> m Int32 Source #

Get the value of the “`scroll-offset`” property. When overloading is enabled, this is equivalent to

    get text #scrollOffset

## tabs

Custom tabs for this text widget.

clearTextTabs :: (MonadIO m, IsText o) => o -> m () Source #

Set the value of the “`tabs`” property to `Nothing`. When overloading is enabled, this is equivalent to

    clear #tabs

constructTextTabs :: (IsText o, MonadIO m) => TabArray -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`tabs`” property. This is rarely needed directly, but it is used by `new`.

getTextTabs :: (MonadIO m, IsText o) => o -> m (Maybe TabArray) Source #

Get the value of the “`tabs`” property. When overloading is enabled, this is equivalent to

    get text #tabs

setTextTabs :: (MonadIO m, IsText o) => o -> TabArray -> m () Source #

Set the value of the “`tabs`” property. When overloading is enabled, this is equivalent to

    set text [ #tabs := value ]

## truncateMultiline

When true, pasted multi-line text is truncated to the first line.

constructTextTruncateMultiline :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`truncate-multiline`” property. This is rarely needed directly, but it is used by `new`.

getTextTruncateMultiline :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`truncate-multiline`” property. When overloading is enabled, this is equivalent to

    get text #truncateMultiline

setTextTruncateMultiline :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`truncate-multiline`” property. When overloading is enabled, this is equivalent to

    set text [ #truncateMultiline := value ]

## visibility

If false, the text is masked with the “invisible char”.

constructTextVisibility :: (IsText o, MonadIO m) => Bool -> m (GValueConstruct o) Source #

Construct a `GValueConstruct` with valid value for the “`visibility`” property. This is rarely needed directly, but it is used by `new`.

getTextVisibility :: (MonadIO m, IsText o) => o -> m Bool Source #

Get the value of the “`visibility`” property. When overloading is enabled, this is equivalent to

    get text #visibility

setTextVisibility :: (MonadIO m, IsText o) => o -> Bool -> m () Source #

Set the value of the “`visibility`” property. When overloading is enabled, this is equivalent to

    set text [ #visibility := value ]

# Signals

## activate

type TextActivateCallback = IO () Source #

Emitted when the user hits the <kbd>Enter</kbd> key.

The default bindings for this signal are all forms of the <kbd>Enter</kbd> key.

afterTextActivate :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #activate callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextActivate :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextActivateCallback) -> m SignalHandlerId Source #

Connect a signal handler for the activate signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #activate callback

## backspace

type TextBackspaceCallback = IO () Source #

Emitted when the user asks for it.

This is a keybinding signal.

The default bindings for this signal are <kbd>Backspace</kbd> and <kbd>Shift</kbd>+<kbd>Backspace</kbd>.

afterTextBackspace :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextBackspaceCallback) -> m SignalHandlerId Source #

Connect a signal handler for the backspace signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #backspace callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextBackspace :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextBackspaceCallback) -> m SignalHandlerId Source #

Connect a signal handler for the backspace signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #backspace callback

## copyClipboard

type TextCopyClipboardCallback = IO () Source #

Emitted to copy the selection to the clipboard.

This is a keybinding signal.

The default bindings for this signal are <kbd>Ctrl</kbd>+<kbd>c</kbd> and <kbd>Ctrl</kbd>+<kbd>Insert</kbd>.

afterTextCopyClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCopyClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the copyClipboard signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #copyClipboard callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextCopyClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCopyClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the copyClipboard signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #copyClipboard callback

## cutClipboard

type TextCutClipboardCallback = IO () Source #

Emitted to cut the selection to the clipboard.

This is a keybinding signal.

The default bindings for this signal are <kbd>Ctrl</kbd>+<kbd>x</kbd> and <kbd>Shift</kbd>+<kbd>Delete</kbd>.

afterTextCutClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCutClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the cutClipboard signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #cutClipboard callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextCutClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextCutClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the cutClipboard signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #cutClipboard callback

## deleteFromCursor

type TextDeleteFromCursorCallback Source #

Arguments

= DeleteType | `type`: the granularity of the deletion
-> Int32 | `count`: the number of `type` units to delete
-> IO () |

Emitted when the user initiates a text deletion.

This is a keybinding signal.

If the `type` is `DeleteTypeChars`, GTK deletes the selection if there is one, otherwise it deletes the requested number of characters.

The default bindings for this signal are <kbd>Delete</kbd> for deleting a character and <kbd>Ctrl</kbd>+<kbd>Delete</kbd> for deleting a word.

afterTextDeleteFromCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextDeleteFromCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the deleteFromCursor signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #deleteFromCursor callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextDeleteFromCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextDeleteFromCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the deleteFromCursor signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #deleteFromCursor callback

## insertAtCursor

type TextInsertAtCursorCallback Source #

Arguments

= Text | `string`: the string to insert
-> IO () |

Emitted when the user initiates the insertion of a fixed string at the cursor.

This is a keybinding signal.

This signal has no default bindings.

afterTextInsertAtCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertAtCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the insertAtCursor signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #insertAtCursor callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextInsertAtCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertAtCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the insertAtCursor signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #insertAtCursor callback

## insertEmoji

type TextInsertEmojiCallback = IO () Source #

Emitted to present the Emoji chooser.

This is a keybinding signal.

The default bindings for this signal are <kbd>Ctrl</kbd>+<kbd>.</kbd> and <kbd>Ctrl</kbd>+<kbd>;</kbd>

afterTextInsertEmoji :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertEmojiCallback) -> m SignalHandlerId Source #

Connect a signal handler for the insertEmoji signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #insertEmoji callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextInsertEmoji :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextInsertEmojiCallback) -> m SignalHandlerId Source #

Connect a signal handler for the insertEmoji signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #insertEmoji callback

## moveCursor

type TextMoveCursorCallback Source #

Arguments

= MovementStep | `step`: the granularity of the move
-> Int32 | `count`: the number of `step` units to move
-> Bool | `extend`: true if the move should extend the selection
-> IO () |

Emitted when the user initiates a cursor movement.

If the cursor is not visible in `self`, this signal causes the viewport to be moved instead.

This is a keybinding signal.

Applications should not connect to it, but may emit it with `GObject.signal_emit_by_name` if they need to control the cursor programmatically.

The default bindings for this signal come in two variants, the variant with the <kbd>Shift</kbd> modifier extends the selection, the variant without it does not. There are too many key combinations to list them all here.

- <kbd>←</kbd>, <kbd>→</kbd>, <kbd>↑</kbd>, <kbd>↓</kbd> move by individual characters/lines
- <kbd>Ctrl</kbd>+<kbd>←</kbd>, etc. move by words/paragraphs
- <kbd>Home</kbd> and <kbd>End</kbd> move to the ends of the buffer

afterTextMoveCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextMoveCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the moveCursor signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #moveCursor callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextMoveCursor :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextMoveCursorCallback) -> m SignalHandlerId Source #

Connect a signal handler for the moveCursor signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #moveCursor callback

## pasteClipboard

type TextPasteClipboardCallback = IO () Source #

Emitted to paste the contents of the clipboard.

This is a keybinding signal.

The default bindings for this signal are <kbd>Ctrl</kbd>+<kbd>v</kbd> and <kbd>Shift</kbd>+<kbd>Insert</kbd>.

afterTextPasteClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPasteClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pasteClipboard signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #pasteClipboard callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextPasteClipboard :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPasteClipboardCallback) -> m SignalHandlerId Source #

Connect a signal handler for the pasteClipboard signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #pasteClipboard callback

## preeditChanged

type TextPreeditChangedCallback Source #

Arguments

= Text | `preedit`: the current preedit string
-> IO () |

Emitted when the preedit text changes.

If an input method is used, the typed text will not immediately be committed to the buffer. So if you are interested in the text, connect to this signal.

afterTextPreeditChanged :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPreeditChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the preeditChanged signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #preeditChanged callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextPreeditChanged :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextPreeditChangedCallback) -> m SignalHandlerId Source #

Connect a signal handler for the preeditChanged signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #preeditChanged callback

## toggleOverwrite

type TextToggleOverwriteCallback = IO () Source #

Emitted to toggle the overwrite mode.

This is a keybinding signal.

The default bindings for this signal is <kbd>Insert</kbd>.

afterTextToggleOverwrite :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextToggleOverwriteCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleOverwrite signal, to be run after the default handler. When overloading is enabled, this is equivalent to

    after text #toggleOverwrite callback

By default the object invoking the signal is not passed to the callback. If you need to access it, you can use the implit `?self` parameter. Note that this requires activating the `ImplicitParams` GHC extension.

onTextToggleOverwrite :: (IsText a, MonadIO m) => a -> ((?self :: a) => TextToggleOverwriteCallback) -> m SignalHandlerId Source #

Connect a signal handler for the toggleOverwrite signal, to be run before the default handler. When overloading is enabled, this is equivalent to

    on text #toggleOverwrite callback