gi-gtk-4.0.8: Gtk bindings
CopyrightWill Thompson and Iñaki García Etxebarria
LicenseLGPL-2.1
MaintainerIñaki García Etxebarria
Safe HaskellSafe-Inferred
LanguageHaskell2010

GI.Gtk.Objects.Text

Description

The GtkText widget is a single-line text entry widget.

GtkText is the common implementation of single-line text editing that is shared between GtkEntry, GtkPasswordEntry, GtkSpinButton and other widgets. In all of these, GtkText is used as the delegate for the Editable implementation.

A fairly large set of key bindings are 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 a “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 are looking to add icons or progress display in an entry, look at GtkEntry. There other alternatives for more specialized use cases, such as GtkSearchEntry.

If you need multi-line editable text, look at GtkTextView.

CSS nodes

text[.read-only]
├── placeholder
├── undershoot.left
├── undershoot.right
├── [selection]
├── [block-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 below text as well.

The undershoot nodes are used to draw the underflow indication when content is scrolled out of view. These nodes get the .left and .right style classes 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

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 #

(/=) :: Text -> Text -> Bool #

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

TypedObject Text Source # 
Instance details

Defined in GI.Gtk.Objects.Text

Methods

glibType :: IO GType

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

gvalueSet_ :: Ptr GValue -> Maybe Text -> IO ()

gvalueGet_ :: Ptr GValue -> IO (Maybe Text)

type ParentTypes Text Source # 
Instance details

Defined in GI.Gtk.Objects.Text

type ParentTypes Text = '[Widget, Object, Accessible, 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, 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, updateNextAccessibleSibling, updateProperty, updateRelation, updateState, watchClosure.

Getters

getAccessibleParent, getAccessibleRole, getActivatesDefault, getAlignment, getAllocatedBaseline, getAllocatedHeight, getAllocatedWidth, getAllocation, getAncestor, getAtContext, getAttributes, 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, 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, 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 GtkText

-> Word64

position: the character position

-> m (Rect, Rect) 

Determine the positions of the strong and weak cursors if the insertion point in the layout is at 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 GtkText

-> m Bool

Returns: True if the GtkText will activate the default widget

Returns whether pressing Enter will activate the default widget for the window containing self.

See textSetActivatesDefault.

getAttributes

textGetAttributes Source #

Arguments

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

self: a GtkText

-> m (Maybe AttrList)

Returns: the attribute list

Gets the attribute list that was set on the GtkText.

See textSetAttributes.

getBuffer

textGetBuffer Source #

Arguments

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

self: a GtkText

-> m EntryBuffer

Returns: A GtkEntryBuffer object.

Get the GtkEntryBuffer object which holds the text for this widget.

getEnableEmojiCompletion

textGetEnableEmojiCompletion Source #

Arguments

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

self: a GtkText

-> m Bool

Returns: True if Emoji completion is enabled

Returns whether Emoji completion is enabled for this GtkText widget.

getExtraMenu

textGetExtraMenu Source #

Arguments

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

self: a GtkText

-> m (Maybe MenuModel)

Returns: the menu model

Gets the menu model for extra items in the context menu.

See textSetExtraMenu.

getInputHints

textGetInputHints Source #

Arguments

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

self: a GtkText

-> m [InputHints] 

Gets the input hints of the GtkText.

getInputPurpose

textGetInputPurpose Source #

Arguments

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

self: a GtkText

-> m InputPurpose 

Gets the input purpose of the GtkText.

getInvisibleChar

textGetInvisibleChar Source #

Arguments

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

self: a GtkText

-> 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 GtkText

-> m Int32

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

Retrieves the maximum allowed length of the text in self.

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 GtkText

-> m Bool

Returns: whether the text is overwritten when typing

Gets whether text is overwritten when typing in the GtkText.

See textSetOverwriteMode.

getPlaceholderText

textGetPlaceholderText Source #

Arguments

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

self: a GtkText

-> m (Maybe Text)

Returns: the placeholder text

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

If no placeholder text has been set, Nothing will be returned.

getPropagateTextWidth

textGetPropagateTextWidth Source #

Arguments

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

self: a GtkText

-> m Bool

Returns: True if self will propagate the text width

Returns whether the GtkText will grow and shrink with the content.

getTabs

textGetTabs Source #

Arguments

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

self: a GtkText

-> m (Maybe TabArray)

Returns: the tabstops

Gets the tabstops that were set on the GtkText.

See textSetTabs.

getTextLength

textGetTextLength Source #

Arguments

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

self: a GtkText

-> m Word16

Returns: the current number of characters in GtkText, or 0 if there are none.

Retrieves the current length of the text in self.

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 GtkText

-> m Bool

Returns: True if self will truncate multi-line text

Returns whether the GtkText will truncate multi-line text that is pasted into the widget

getVisibility

textGetVisibility Source #

Arguments

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

self: a GtkText

-> m Bool

Returns: True if the text is currently visible

Retrieves whether the text in self is visible.

grabFocusWithoutSelecting

textGrabFocusWithoutSelecting Source #

Arguments

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

self: a GtkText

-> m Bool

Returns: True if focus is now inside self

Causes self to have keyboard focus.

It behaves like widgetGrabFocus, except that it doesn't 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: a new GtkText.

Creates a new GtkText.

newWithBuffer

textNewWithBuffer Source #

Arguments

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

buffer: The buffer to use for the new GtkText.

-> m Text

Returns: a new GtkText

Creates a new GtkText with the specified text buffer.

setActivatesDefault

textSetActivatesDefault Source #

Arguments

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

self: a GtkText

-> Bool

activates: True to activate window’s default widget on Enter keypress

-> m () 

If activates is True, pressing Enter will activate the default widget for the window containing self.

This usually means that the dialog containing the GtkText 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 GtkText

-> Maybe AttrList

attrs: a PangoAttrList

-> m () 

Sets attributes that are applied to the text.

setBuffer

textSetBuffer Source #

Arguments

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

self: a GtkText

-> b

buffer: a GtkEntryBuffer

-> m () 

Set the GtkEntryBuffer object which holds the text for this widget.

setEnableEmojiCompletion

textSetEnableEmojiCompletion Source #

Arguments

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

self: a GtkText

-> 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 GtkText

-> Maybe b

model: a GMenuModel

-> m () 

Sets a menu model to add when constructing the context menu for self.

setInputHints

textSetInputHints Source #

Arguments

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

self: a GtkText

-> [InputHints]

hints: the hints

-> m () 

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

setInputPurpose

textSetInputPurpose Source #

Arguments

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

self: a GtkText

-> InputPurpose

purpose: the purpose

-> m () 

Sets the input purpose of the GtkText.

This 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 GtkText

-> 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 GtkText

-> Int32

length: the maximum length of the GtkText, 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 widget.

If the current contents are longer than the given length, then 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 GtkText

-> Bool

overwrite: new value

-> m () 

Sets whether the text is overwritten when typing in the GtkText.

setPlaceholderText

textSetPlaceholderText Source #

Arguments

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

self: a GtkText

-> Maybe Text

text: a string to be displayed when self is empty and unfocused

-> m () 

Sets text to be displayed in self when it is empty.

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

setPropagateTextWidth

textSetPropagateTextWidth Source #

Arguments

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

self: a GtkText

-> Bool

propagateTextWidth: True to propagate the text width

-> m () 

Sets whether the GtkText should grow and shrink with the content.

setTabs

textSetTabs Source #

Arguments

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

self: a GtkText

-> Maybe TabArray

tabs: a PangoTabArray

-> m () 

Sets tabstops that are applied to the text.

setTruncateMultiline

textSetTruncateMultiline Source #

Arguments

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

self: a GtkText

-> Bool

truncateMultiline: True to truncate multi-line text

-> m () 

Sets whether the GtkText should truncate multi-line text that is pasted into the widget.

setVisibility

textSetVisibility Source #

Arguments

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

self: a GtkText

-> Bool

visible: True if the contents of the GtkText are displayed as plaintext

-> m () 

Sets whether the contents of the GtkText are visible or not.

When visibility is set to False, characters are displayed as the invisible char, and 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 self, in addition to setting visibility to False.

unsetInvisibleChar

textUnsetInvisibleChar Source #

Arguments

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

self: a GtkText

-> m () 

Unsets the invisible char.

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

Properties

activatesDefault

Whether to activate the default widget when Enter 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 of the GtkText.

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 IM (input method) module should be used for this self.

See IMMulticontext.

Setting this to a non-Nothing value overrides the system-wide IM module setting. See the Settings:gtkImModule property.

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 property 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 for the GtkText.

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 in the GtkText.

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

A list of tabstops to apply to the text of the GtkText.

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, as a GtkDeleteType

-> 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 for the widget.

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, as a GtkMovementStep

-> 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 g_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 of the GtkText.

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