gi-gtk-3.0.11: Gtk bindings

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

GI.Gtk.Objects.TextView

Contents

Description

You may wish to begin by reading the [text widget conceptual overview][TextWidget] which gives an overview of all the objects and data types related to the text widget and how they work together.

CSS nodes

plain code

textview.view
├── border.top
├── border.left
├── text
│   ╰── [selection]
├── border.right
├── border.bottom
╰── [window.popup]

GtkTextView has a main css node with name textview and style class .view, and subnodes for each of the border windows, and the main text area, with names border and text, respectively. The border nodes each get one of the style classes .left, .right, .top or .bottom.

A node representing the selection will appear below the text node.

If a context menu is opened, the window node will appear as a subnode of the main node.

Synopsis

Exported types

Methods

addChildAtAnchor

textViewAddChildAtAnchor Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsWidget b, IsTextChildAnchor c) 
=> a

textView: a TextView

-> b

child: a Widget

-> c

anchor: a TextChildAnchor in the TextBuffer for textView

-> m () 

Adds a child widget in the text buffer, at the given anchor.

addChildInWindow

textViewAddChildInWindow Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsWidget b) 
=> a

textView: a TextView

-> b

child: a Widget

-> TextWindowType

whichWindow: which window the child should appear in

-> Int32

xpos: X position of child in window coordinates

-> Int32

ypos: Y position of child in window coordinates

-> m () 

Adds a child at fixed coordinates in one of the text widget's windows.

The window must have nonzero size (see textViewSetBorderWindowSize). Note that the child coordinates are given relative to scrolling. When placing a child in GTK_TEXT_WINDOW_WIDGET, scrolling is irrelevant, the child floats above all scrollable areas. But when placing a child in one of the scrollable windows (border windows or text window) it will move with the scrolling as needed.

backwardDisplayLine

textViewBackwardDisplayLine Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Bool

Returns: True if iter was moved and is not on the end iterator

Moves the given iter backward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

backwardDisplayLineStart

textViewBackwardDisplayLineStart Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Bool

Returns: True if iter was moved and is not on the end iterator

Moves the given iter backward to the next display line start. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

bufferToWindowCoords

textViewBufferToWindowCoords Source #

Arguments

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

textView: a TextView

-> TextWindowType

win: a TextWindowType except GTK_TEXT_WINDOW_PRIVATE

-> Int32

bufferX: buffer x coordinate

-> Int32

bufferY: buffer y coordinate

-> m (Int32, Int32) 

Converts coordinate (bufferX, bufferY) to coordinates for the window win, and stores the result in (windowX, windowY).

Note that you can’t convert coordinates for a nonexisting window (see textViewSetBorderWindowSize).

forwardDisplayLine

textViewForwardDisplayLine Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Bool

Returns: True if iter was moved and is not on the end iterator

Moves the given iter forward by one display (wrapped) line. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

forwardDisplayLineEnd

textViewForwardDisplayLineEnd Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Bool

Returns: True if iter was moved and is not on the end iterator

Moves the given iter forward to the next display line end. A display line is different from a paragraph. Paragraphs are separated by newlines or other paragraph separator characters. Display lines are created by line-wrapping a paragraph. If wrapping is turned off, display lines and paragraphs will be the same. Display lines are divided differently for each view, since they depend on the view’s width; paragraphs are the same in all views, since they depend on the contents of the TextBuffer.

getAcceptsTab

textViewGetAcceptsTab Source #

Arguments

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

textView: A TextView

-> m Bool

Returns: True if pressing the Tab key inserts a tab character, False if pressing the Tab key moves the keyboard focus.

Returns whether pressing the Tab key inserts a tab characters. textViewSetAcceptsTab.

Since: 2.4

getBorderWindowSize

textViewGetBorderWindowSize Source #

Arguments

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

textView: a TextView

-> TextWindowType

type: window to return size from

-> m Int32

Returns: width of window

Gets the width of the specified border window. See textViewSetBorderWindowSize.

getBottomMargin

textViewGetBottomMargin Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: bottom margin in pixels

Gets the bottom margin for text in the textView.

Since: 3.18

getBuffer

textViewGetBuffer Source #

Arguments

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

textView: a TextView

-> m TextBuffer

Returns: a TextBuffer

Returns the TextBuffer being displayed by this text view. The reference count on the buffer is not incremented; the caller of this function won’t own a new reference.

getCursorLocations

textViewGetCursorLocations Source #

Arguments

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

textView: a TextView

-> Maybe TextIter

iter: a TextIter

-> m (Rectangle, Rectangle) 

Given an iter within a text layout, determine the positions of the strong and weak cursors if the insertion point is at that iterator. 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 of the paragraph are inserted. The weak cursor location is the location where characters of the directionality opposite to the base direction of the paragraph are inserted.

If iter is Nothing, the actual cursor position is used.

Note that if iter happens to be the actual cursor position, and there is currently an IM preedit sequence being entered, the returned locations will be adjusted to account for the preedit cursor’s offset within the preedit sequence.

The rectangle position is in buffer coordinates; use textViewBufferToWindowCoords to convert these coordinates to coordinates for one of the windows in the text view.

Since: 3.0

getCursorVisible

textViewGetCursorVisible Source #

Arguments

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

textView: a TextView

-> m Bool

Returns: whether the insertion mark is visible

Find out whether the cursor should be displayed.

getDefaultAttributes

textViewGetDefaultAttributes Source #

Arguments

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

textView: a TextView

-> m TextAttributes

Returns: a new TextAttributes

Obtains a copy of the default text attributes. These are the attributes used for text unless a tag overrides them. You’d typically pass the default attributes in to textIterGetAttributes in order to get the attributes in effect at a given text position.

The return value is a copy owned by the caller of this function, and should be freed with textAttributesUnref.

getEditable

textViewGetEditable Source #

Arguments

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

textView: a TextView

-> m Bool

Returns: whether text is editable by default

Returns the default editability of the TextView. Tags in the buffer may override this setting for some ranges of text.

getHadjustment

textViewGetHadjustment Source #

Arguments

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

textView: a TextView

-> m Adjustment

Returns: pointer to the horizontal Adjustment

Deprecated: (Since version 3.0)Use scrollableGetHadjustment

Gets the horizontal-scrolling Adjustment.

Since: 2.22

getIndent

textViewGetIndent Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: number of pixels of indentation

Gets the default indentation of paragraphs in textView. Tags in the view’s buffer may override the default. The indentation may be negative.

getInputHints

textViewGetInputHints Source #

Arguments

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

textView: a TextView

-> m [InputHints] 

Gets the value of the TextView:input-hints property.

Since: 3.6

getInputPurpose

textViewGetInputPurpose Source #

Arguments

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

textView: a TextView

-> m InputPurpose 

Gets the value of the TextView:input-purpose property.

Since: 3.6

getIterAtLocation

textViewGetIterAtLocation Source #

Arguments

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

textView: a TextView

-> Int32

x: x position, in buffer coordinates

-> Int32

y: y position, in buffer coordinates

-> m (Bool, TextIter)

Returns: True if the position is over text

Retrieves the iterator at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with textViewWindowToBufferCoords.

getIterAtPosition

textViewGetIterAtPosition Source #

Arguments

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

textView: a TextView

-> Int32

x: x position, in buffer coordinates

-> Int32

y: y position, in buffer coordinates

-> m (Bool, TextIter, Int32)

Returns: True if the position is over text

Retrieves the iterator pointing to the character at buffer coordinates x and y. Buffer coordinates are coordinates for the entire buffer, not just the currently-displayed portion. If you have coordinates from an event, you have to convert those to buffer coordinates with textViewWindowToBufferCoords.

Note that this is different from textViewGetIterAtLocation, which returns cursor locations, i.e. positions between characters.

Since: 2.6

getIterLocation

textViewGetIterLocation Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Rectangle 

Gets a rectangle which roughly contains the character at iter. The rectangle position is in buffer coordinates; use textViewBufferToWindowCoords to convert these coordinates to coordinates for one of the windows in the text view.

getJustification

textViewGetJustification Source #

Arguments

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

textView: a TextView

-> m Justification

Returns: default justification

Gets the default justification of paragraphs in textView. Tags in the buffer may override the default.

getLeftMargin

textViewGetLeftMargin Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: left margin in pixels

Gets the default left margin size of paragraphs in the textView. Tags in the buffer may override the default.

getLineAtY

textViewGetLineAtY Source #

Arguments

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

textView: a TextView

-> Int32

y: a y coordinate

-> m (TextIter, Int32) 

Gets the TextIter at the start of the line containing the coordinate y. y is in buffer coordinates, convert from window coordinates with textViewWindowToBufferCoords. If non-Nothing, lineTop will be filled with the coordinate of the top edge of the line.

getLineYrange

textViewGetLineYrange Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m (Int32, Int32) 

Gets the y coordinate of the top of the line containing iter, and the height of the line. The coordinate is a buffer coordinate; convert to window coordinates with textViewBufferToWindowCoords.

getMonospace

textViewGetMonospace Source #

Arguments

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

textView: a TextView

-> m Bool

Returns: True if monospace fonts are desired

Gets the value of the TextView:monospace property.

Since: 3.16

getOverwrite

textViewGetOverwrite Source #

Arguments

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

textView: a TextView

-> m Bool

Returns: whether textView is in overwrite mode or not.

Returns whether the TextView is in overwrite mode or not.

Since: 2.4

getPixelsAboveLines

textViewGetPixelsAboveLines Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: default number of pixels above paragraphs

Gets the default number of pixels to put above paragraphs. Adding this function with textViewGetPixelsBelowLines is equal to the line space between each paragraph.

getPixelsBelowLines

textViewGetPixelsBelowLines Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: default number of blank pixels below paragraphs

Gets the value set by textViewSetPixelsBelowLines.

The line space is the sum of the value returned by this function and the value returned by textViewGetPixelsAboveLines.

getPixelsInsideWrap

textViewGetPixelsInsideWrap Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: default number of pixels of blank space between wrapped lines

Gets the value set by textViewSetPixelsInsideWrap.

getRightMargin

textViewGetRightMargin Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: right margin in pixels

Gets the default right margin for text in textView. Tags in the buffer may override the default.

getTabs

textViewGetTabs Source #

Arguments

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

textView: a TextView

-> m (Maybe TabArray)

Returns: copy of default tab array, or Nothing if “standard" tabs are used; must be freed with tabArrayFree.

Gets the default tabs for textView. Tags in the buffer may override the defaults. The returned array will be Nothing if “standard” (8-space) tabs are used. Free the return value with tabArrayFree.

getTopMargin

textViewGetTopMargin Source #

Arguments

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

textView: a TextView

-> m Int32

Returns: top margin in pixels

Gets the top margin for text in the textView.

Since: 3.18

getVadjustment

textViewGetVadjustment Source #

Arguments

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

textView: a TextView

-> m Adjustment

Returns: pointer to the vertical Adjustment

Deprecated: (Since version 3.0)Use scrollableGetVadjustment

Gets the vertical-scrolling Adjustment.

Since: 2.22

getVisibleRect

textViewGetVisibleRect Source #

Arguments

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

textView: a TextView

-> m Rectangle 

Fills visibleRect with the currently-visible region of the buffer, in buffer coordinates. Convert to window coordinates with textViewBufferToWindowCoords.

getWindow

textViewGetWindow Source #

Arguments

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

textView: a TextView

-> TextWindowType

win: window to get

-> m (Maybe Window)

Returns: a Window, or Nothing

Retrieves the Window corresponding to an area of the text view; possible windows include the overall widget window, child windows on the left, right, top, bottom, and the window that displays the text buffer. Windows are Nothing and nonexistent if their width or height is 0, and are nonexistent before the widget has been realized.

getWindowType

textViewGetWindowType Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsWindow b) 
=> a

textView: a TextView

-> b

window: a window type

-> m TextWindowType

Returns: the window type.

Usually used to find out which window an event corresponds to. If you connect to an event signal on textView, this function should be called on event->window to see which window it was.

getWrapMode

textViewGetWrapMode Source #

Arguments

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

textView: a TextView

-> m WrapMode

Returns: the line wrap setting

Gets the line wrapping for the view.

imContextFilterKeypress

textViewImContextFilterKeypress Source #

Arguments

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

textView: a TextView

-> EventKey

event: the key event

-> m Bool

Returns: True if the input method handled the key event.

Allow the TextView input method to internally handle key press and release events. If this function returns True, then no further processing should be done for this key event. See iMContextFilterKeypress.

Note that you are expected to call this function from your handler when overriding key event handling. This is needed in the case when you need to insert your own key handling between the input method and the default key event handling of the TextView.

C code

static gboolean
gtk_foo_bar_key_press_event (GtkWidget   *widget,
                             GdkEventKey *event)
{
  if ((key->keyval == GDK_KEY_Return || key->keyval == GDK_KEY_KP_Enter))
    {
      if (gtk_text_view_im_context_filter_keypress (GTK_TEXT_VIEW (view), event))
        return TRUE;
    }

    // Do some stuff

  return GTK_WIDGET_CLASS (gtk_foo_bar_parent_class)->key_press_event (widget, event);
}

Since: 2.22

moveChild

data TextViewMoveChildMethodInfo Source #

Instances

((~) * signature (b -> Int32 -> Int32 -> m ()), MonadIO m, IsTextView a, IsWidget b) => MethodInfo * TextViewMoveChildMethodInfo a signature Source # 

textViewMoveChild Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsWidget b) 
=> a

textView: a TextView

-> b

child: child widget already added to the text view

-> Int32

xpos: new X position in window coordinates

-> Int32

ypos: new Y position in window coordinates

-> m () 

Updates the position of a child, as for textViewAddChildInWindow.

moveMarkOnscreen

textViewMoveMarkOnscreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsTextMark b) 
=> a

textView: a TextView

-> b

mark: a TextMark

-> m Bool

Returns: True if the mark moved (wasn’t already onscreen)

Moves a mark within the buffer so that it's located within the currently-visible text area.

moveVisually

textViewMoveVisually Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> Int32

count: number of characters to move (negative moves left, positive moves right)

-> m Bool

Returns: True if iter moved and is not on the end iterator

Move the iterator a given number of characters visually, treating it as the strong cursor position. If count is positive, then the new strong cursor position will be count positions to the right of the old cursor position. If count is negative then the new strong cursor position will be count positions to the left of the old cursor position.

In the presence of bi-directional text, the correspondence between logical and visual order will depend on the direction of the current run, and there may be jumps when the cursor is moved off of the end of a run.

new

textViewNew Source #

Arguments

:: (HasCallStack, MonadIO m) 
=> m TextView

Returns: a new TextView

Creates a new TextView. If you don’t call textViewSetBuffer before using the text view, an empty default buffer will be created for you. Get the buffer with textViewGetBuffer. If you want to specify your own buffer, consider textViewNewWithBuffer.

newWithBuffer

textViewNewWithBuffer Source #

Arguments

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

buffer: a TextBuffer

-> m TextView

Returns: a new TextView.

Creates a new TextView widget displaying the buffer buffer. One buffer can be shared among many widgets. buffer may be Nothing to create a default buffer, in which case this function is equivalent to textViewNew. The text view adds its own reference count to the buffer; it does not take over an existing reference.

placeCursorOnscreen

textViewPlaceCursorOnscreen Source #

Arguments

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

textView: a TextView

-> m Bool

Returns: True if the cursor had to be moved.

Moves the cursor to the currently visible region of the buffer, it it isn’t there already.

resetCursorBlink

textViewResetCursorBlink Source #

Arguments

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

textView: a TextView

-> m () 

Ensures that the cursor is shown (i.e. not in an 'off' blink interval) and resets the time that it will stay blinking (or visible, in case blinking is disabled).

This function should be called in response to user input (e.g. from derived classes that override the textview's Widget::key-press-event handler).

Since: 3.20

resetImContext

textViewResetImContext Source #

Arguments

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

textView: a TextView

-> m () 

Reset the input method context of the text view if needed.

This can be necessary in the case where modifying the buffer would confuse on-going input method behavior.

Since: 2.22

scrollMarkOnscreen

textViewScrollMarkOnscreen Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsTextMark b) 
=> a

textView: a TextView

-> b

mark: a mark in the buffer for textView

-> m () 

Scrolls textView the minimum distance such that mark is contained within the visible area of the widget.

scrollToIter

textViewScrollToIter Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> Double

withinMargin: margin as a [0.0,0.5) fraction of screen size

-> Bool

useAlign: whether to use alignment arguments (if False, just get the mark onscreen)

-> Double

xalign: horizontal alignment of mark within visible area

-> Double

yalign: vertical alignment of mark within visible area

-> m Bool

Returns: True if scrolling occurred

Scrolls textView so that iter is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If useAlign is False, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size withinMargin.

Note that this function uses the currently-computed height of the lines in the text buffer. Line heights are computed in an idle handler; so this function may not have the desired effect if it’s called before the height computations. To avoid oddness, consider using textViewScrollToMark which saves a point to be scrolled to after line validation.

scrollToMark

textViewScrollToMark Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsTextMark b) 
=> a

textView: a TextView

-> b

mark: a TextMark

-> Double

withinMargin: margin as a [0.0,0.5) fraction of screen size

-> Bool

useAlign: whether to use alignment arguments (if False, just get the mark onscreen)

-> Double

xalign: horizontal alignment of mark within visible area

-> Double

yalign: vertical alignment of mark within visible area

-> m () 

Scrolls textView so that mark is on the screen in the position indicated by xalign and yalign. An alignment of 0.0 indicates left or top, 1.0 indicates right or bottom, 0.5 means center. If useAlign is False, the text scrolls the minimal distance to get the mark onscreen, possibly not scrolling at all. The effective screen for purposes of this function is reduced by a margin of size withinMargin.

setAcceptsTab

textViewSetAcceptsTab Source #

Arguments

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

textView: A TextView

-> Bool

acceptsTab: True if pressing the Tab key should insert a tab character, False, if pressing the Tab key should move the keyboard focus.

-> m () 

Sets the behavior of the text widget when the Tab key is pressed. If acceptsTab is True, a tab character is inserted. If acceptsTab is False the keyboard focus is moved to the next widget in the focus chain.

Since: 2.4

setBorderWindowSize

textViewSetBorderWindowSize Source #

Arguments

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

textView: a TextView

-> TextWindowType

type: window to affect

-> Int32

size: width or height of the window

-> m () 

Sets the width of TextWindowTypeLeft or TextWindowTypeRight, or the height of TextWindowTypeTop or TextWindowTypeBottom. Automatically destroys the corresponding window if the size is set to 0, and creates the window if the size is set to non-zero. This function can only be used for the “border windows,” it doesn’t work with GTK_TEXT_WINDOW_WIDGET, GTK_TEXT_WINDOW_TEXT, or GTK_TEXT_WINDOW_PRIVATE.

setBottomMargin

textViewSetBottomMargin Source #

Arguments

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

textView: a TextView

-> Int32

bottomMargin: bottom margin in pixels

-> m () 

Sets the bottom margin for text in textView.

Note that this function is confusingly named. In CSS terms, the value set here is padding.

Since: 3.18

setBuffer

data TextViewSetBufferMethodInfo Source #

Instances

((~) * signature (Maybe b -> m ()), MonadIO m, IsTextView a, IsTextBuffer b) => MethodInfo * TextViewSetBufferMethodInfo a signature Source # 

textViewSetBuffer Source #

Arguments

:: (HasCallStack, MonadIO m, IsTextView a, IsTextBuffer b) 
=> a

textView: a TextView

-> Maybe b

buffer: a TextBuffer

-> m () 

Sets buffer as the buffer being displayed by textView. The previous buffer displayed by the text view is unreferenced, and a reference is added to buffer. If you owned a reference to buffer before passing it to this function, you must remove that reference yourself; TextView will not “adopt” it.

setCursorVisible

textViewSetCursorVisible Source #

Arguments

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

textView: a TextView

-> Bool

setting: whether to show the insertion cursor

-> m () 

Toggles whether the insertion point should be displayed. A buffer with no editable text probably shouldn’t have a visible cursor, so you may want to turn the cursor off.

Note that this property may be overridden by the Settings:gtk-keynave-use-caret settings.

setEditable

textViewSetEditable Source #

Arguments

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

textView: a TextView

-> Bool

setting: whether it’s editable

-> m () 

Sets the default editability of the TextView. You can override this default setting with tags in the buffer, using the “editable” attribute of tags.

setIndent

data TextViewSetIndentMethodInfo Source #

Instances

((~) * signature (Int32 -> m ()), MonadIO m, IsTextView a) => MethodInfo * TextViewSetIndentMethodInfo a signature Source # 

textViewSetIndent Source #

Arguments

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

textView: a TextView

-> Int32

indent: indentation in pixels

-> m () 

Sets the default indentation for paragraphs in textView. Tags in the buffer may override the default.

setInputHints

textViewSetInputHints Source #

Arguments

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

textView: a TextView

-> [InputHints]

hints: the hints

-> m () 

Sets the TextView:input-hints property, which allows input methods to fine-tune their behaviour.

Since: 3.6

setInputPurpose

textViewSetInputPurpose Source #

Arguments

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

textView: a TextView

-> InputPurpose

purpose: the purpose

-> m () 

Sets the TextView:input-purpose property which can be used by on-screen keyboards and other input methods to adjust their behaviour.

Since: 3.6

setJustification

textViewSetJustification Source #

Arguments

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

textView: a TextView

-> Justification

justification: justification

-> m () 

Sets the default justification of text in textView. Tags in the view’s buffer may override the default.

setLeftMargin

textViewSetLeftMargin Source #

Arguments

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

textView: a TextView

-> Int32

leftMargin: left margin in pixels

-> m () 

Sets the default left margin for text in textView. Tags in the buffer may override the default.

Note that this function is confusingly named. In CSS terms, the value set here is padding.

setMonospace

textViewSetMonospace Source #

Arguments

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

textView: a TextView

-> Bool

monospace: True to request monospace styling

-> m () 

Sets the TextView:monospace property, which indicates that the text view should use monospace fonts.

Since: 3.16

setOverwrite

textViewSetOverwrite Source #

Arguments

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

textView: a TextView

-> Bool

overwrite: True to turn on overwrite mode, False to turn it off

-> m () 

Changes the TextView overwrite mode.

Since: 2.4

setPixelsAboveLines

textViewSetPixelsAboveLines Source #

Arguments

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

textView: a TextView

-> Int32

pixelsAboveLines: pixels above paragraphs

-> m () 

Sets the default number of blank pixels above paragraphs in textView. Tags in the buffer for textView may override the defaults.

setPixelsBelowLines

textViewSetPixelsBelowLines Source #

Arguments

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

textView: a TextView

-> Int32

pixelsBelowLines: pixels below paragraphs

-> m () 

Sets the default number of pixels of blank space to put below paragraphs in textView. May be overridden by tags applied to textView’s buffer.

setPixelsInsideWrap

textViewSetPixelsInsideWrap Source #

Arguments

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

textView: a TextView

-> Int32

pixelsInsideWrap: default number of pixels between wrapped lines

-> m () 

Sets the default number of pixels of blank space to leave between display/wrapped lines within a paragraph. May be overridden by tags in textView’s buffer.

setRightMargin

textViewSetRightMargin Source #

Arguments

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

textView: a TextView

-> Int32

rightMargin: right margin in pixels

-> m () 

Sets the default right margin for text in the text view. Tags in the buffer may override the default.

Note that this function is confusingly named. In CSS terms, the value set here is padding.

setTabs

data TextViewSetTabsMethodInfo Source #

Instances

((~) * signature (TabArray -> m ()), MonadIO m, IsTextView a) => MethodInfo * TextViewSetTabsMethodInfo a signature Source # 

textViewSetTabs Source #

Arguments

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

textView: a TextView

-> TabArray

tabs: tabs as a TabArray

-> m () 

Sets the default tab stops for paragraphs in textView. Tags in the buffer may override the default.

setTopMargin

textViewSetTopMargin Source #

Arguments

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

textView: a TextView

-> Int32

topMargin: top margin in pixels

-> m () 

Sets the top margin for text in textView.

Note that this function is confusingly named. In CSS terms, the value set here is padding.

Since: 3.18

setWrapMode

textViewSetWrapMode Source #

Arguments

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

textView: a TextView

-> WrapMode

wrapMode: a WrapMode

-> m () 

Sets the line wrapping for the view.

startsDisplayLine

textViewStartsDisplayLine Source #

Arguments

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

textView: a TextView

-> TextIter

iter: a TextIter

-> m Bool

Returns: True if iter begins a wrapped line

Determines whether iter is at the start of a display line. See textViewForwardDisplayLine for an explanation of display lines vs. paragraphs.

windowToBufferCoords

textViewWindowToBufferCoords Source #

Arguments

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

textView: a TextView

-> TextWindowType

win: a TextWindowType except GTK_TEXT_WINDOW_PRIVATE

-> Int32

windowX: window x coordinate

-> Int32

windowY: window y coordinate

-> m (Int32, Int32) 

Converts coordinates on the window identified by win to buffer coordinates, storing the result in (bufferX,bufferY).

Note that you can’t convert coordinates for a nonexisting window (see textViewSetBorderWindowSize).

Properties

acceptsTab

data TextViewAcceptsTabPropertyInfo Source #

Instances

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

bottomMargin

data TextViewBottomMarginPropertyInfo Source #

Instances

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

buffer

data TextViewBufferPropertyInfo Source #

Instances

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

setTextViewBuffer :: (MonadIO m, IsTextView o, IsTextBuffer a) => o -> a -> m () Source #

cursorVisible

data TextViewCursorVisiblePropertyInfo Source #

Instances

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

editable

data TextViewEditablePropertyInfo Source #

Instances

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

imModule

data TextViewImModulePropertyInfo Source #

Instances

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

indent

data TextViewIndentPropertyInfo Source #

Instances

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

setTextViewIndent :: (MonadIO m, IsTextView o) => o -> Int32 -> m () Source #

inputHints

data TextViewInputHintsPropertyInfo Source #

Instances

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

inputPurpose

data TextViewInputPurposePropertyInfo Source #

Instances

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

justification

data TextViewJustificationPropertyInfo Source #

Instances

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

leftMargin

data TextViewLeftMarginPropertyInfo Source #

Instances

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

monospace

data TextViewMonospacePropertyInfo Source #

Instances

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

overwrite

data TextViewOverwritePropertyInfo Source #

Instances

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

pixelsAboveLines

data TextViewPixelsAboveLinesPropertyInfo Source #

Instances

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

pixelsBelowLines

data TextViewPixelsBelowLinesPropertyInfo Source #

Instances

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

pixelsInsideWrap

data TextViewPixelsInsideWrapPropertyInfo Source #

Instances

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

populateAll

data TextViewPopulateAllPropertyInfo Source #

Instances

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

rightMargin

data TextViewRightMarginPropertyInfo Source #

Instances

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

tabs

data TextViewTabsPropertyInfo Source #

Instances

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

topMargin

data TextViewTopMarginPropertyInfo Source #

Instances

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

wrapMode

data TextViewWrapModePropertyInfo Source #

Instances

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

Signals

backspace

copyClipboard

cutClipboard

deleteFromCursor

extendSelection

insertAtCursor

moveCursor

type C_TextViewMoveCursorCallback = Ptr () -> CUInt -> Int32 -> CInt -> Ptr () -> IO () Source #

moveViewport

pasteClipboard

populatePopup

preeditChanged

selectAll

type C_TextViewSelectAllCallback = Ptr () -> CInt -> Ptr () -> IO () Source #

setAnchor

toggleCursorVisible

toggleOverwrite