gtk3-0.15.10: Binding to the Gtk+ 3 graphical user interface library

Maintainer | gtk2hs-users@lists.sourceforge.net
Stability | provisional
Portability | portable (depends on GHC)
Safe Haskell | None
Language | Haskell98

Graphics.UI.Gtk.Multiline.TextView

Contents

- Detail
- Class Hierarchy
- Types
- Constructors
- Methods
- Attributes
- Signals

Description

Widget that displays a `TextBuffer`

Synopsis

- data TextView
- class ContainerClass o => TextViewClass o
- data TextChildAnchor
- class GObjectClass o => TextChildAnchorClass o
- castToTextView :: GObjectClass obj => obj -> TextView
- gTypeTextView :: GType
- toTextView :: TextViewClass o => o -> TextView
- data DeleteType
  - = DeleteChars
  - | DeleteWordEnds
  - | DeleteWords
  - | DeleteDisplayLines
  - | DeleteDisplayLineEnds
  - | DeleteParagraphEnds
  - | DeleteParagraphs
  - | DeleteWhitespace
- data DirectionType
  - = DirTabForward
  - | DirTabBackward
  - | DirUp
  - | DirDown
  - | DirLeft
  - | DirRight
- data Justification
  - = JustifyLeft
  - | JustifyRight
  - | JustifyCenter
  - | JustifyFill
- data MovementStep
  - = MovementLogicalPositions
  - | MovementVisualPositions
  - | MovementWords
  - | MovementDisplayLines
  - | MovementDisplayLineEnds
  - | MovementParagraphs
  - | MovementParagraphEnds
  - | MovementPages
  - | MovementBufferEnds
  - | MovementHorizontalPages
- data TextWindowType
  - = TextWindowPrivate
  - | TextWindowWidget
  - | TextWindowText
  - | TextWindowLeft
  - | TextWindowRight
  - | TextWindowTop
  - | TextWindowBottom
- data WrapMode
  - = WrapNone
  - | WrapChar
  - | WrapWord
  - | WrapWordChar
- textViewNew :: IO TextView
- textViewNewWithBuffer :: TextBufferClass buffer => buffer -> IO TextView
- textViewSetBuffer :: (TextViewClass self, TextBufferClass buffer) => self -> buffer -> IO ()
- textViewGetBuffer :: TextViewClass self => self -> IO TextBuffer
- textViewScrollToMark :: (TextViewClass self, TextMarkClass mark) => self -> mark -> Double -> Maybe (Double, Double) -> IO ()
- textViewScrollToIter :: TextViewClass self => self -> TextIter -> Double -> Maybe (Double, Double) -> IO Bool
- textViewScrollMarkOnscreen :: (TextViewClass self, TextMarkClass mark) => self -> mark -> IO ()
- textViewMoveMarkOnscreen :: (TextViewClass self, TextMarkClass mark) => self -> mark -> IO Bool
- textViewPlaceCursorOnscreen :: TextViewClass self => self -> IO Bool
- textViewGetLineAtY :: TextViewClass self => self -> Int -> IO (TextIter, Int)
- textViewGetLineYrange :: TextViewClass self => self -> TextIter -> IO (Int, Int)
- textViewGetIterAtLocation :: TextViewClass self => self -> Int -> Int -> IO TextIter
- textViewBufferToWindowCoords :: TextViewClass self => self -> TextWindowType -> (Int, Int) -> IO (Int, Int)
- textViewWindowToBufferCoords :: TextViewClass self => self -> TextWindowType -> (Int, Int) -> IO (Int, Int)
- textViewGetWindow :: TextViewClass self => self -> TextWindowType -> IO (Maybe DrawWindow)
- textViewGetWindowType :: TextViewClass self => self -> DrawWindow -> IO TextWindowType
- textViewSetBorderWindowSize :: TextViewClass self => self -> TextWindowType -> Int -> IO ()
- textViewGetBorderWindowSize :: TextViewClass self => self -> TextWindowType -> IO Int
- textViewForwardDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool
- textViewBackwardDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool
- textViewForwardDisplayLineEnd :: TextViewClass self => self -> TextIter -> IO Bool
- textViewBackwardDisplayLineStart :: TextViewClass self => self -> TextIter -> IO Bool
- textViewStartsDisplayLine :: TextViewClass self => self -> TextIter -> IO Bool
- textViewMoveVisually :: TextViewClass self => self -> TextIter -> Int -> IO Bool
- textViewAddChildAtAnchor :: (TextViewClass self, WidgetClass child) => self -> child -> TextChildAnchor -> IO ()
- textChildAnchorNew :: IO TextChildAnchor
- textChildAnchorGetWidgets :: TextChildAnchor -> IO [Widget]
- textChildAnchorGetDeleted :: TextChildAnchor -> IO Bool
- textViewAddChildInWindow :: (TextViewClass self, WidgetClass child) => self -> child -> TextWindowType -> Int -> Int -> IO ()
- textViewMoveChild :: (TextViewClass self, WidgetClass child) => self -> child -> Int -> Int -> IO ()
- textViewSetWrapMode :: TextViewClass self => self -> WrapMode -> IO ()
- textViewGetWrapMode :: TextViewClass self => self -> IO WrapMode
- textViewSetEditable :: TextViewClass self => self -> Bool -> IO ()
- textViewGetEditable :: TextViewClass self => self -> IO Bool
- textViewSetCursorVisible :: TextViewClass self => self -> Bool -> IO ()
- textViewGetCursorVisible :: TextViewClass self => self -> IO Bool
- textViewSetPixelsAboveLines :: TextViewClass self => self -> Int -> IO ()
- textViewGetPixelsAboveLines :: TextViewClass self => self -> IO Int
- textViewSetPixelsBelowLines :: TextViewClass self => self -> Int -> IO ()
- textViewGetPixelsBelowLines :: TextViewClass self => self -> IO Int
- textViewSetPixelsInsideWrap :: TextViewClass self => self -> Int -> IO ()
- textViewGetPixelsInsideWrap :: TextViewClass self => self -> IO Int
- textViewSetJustification :: TextViewClass self => self -> Justification -> IO ()
- textViewGetJustification :: TextViewClass self => self -> IO Justification
- textViewSetLeftMargin :: TextViewClass self => self -> Int -> IO ()
- textViewGetLeftMargin :: TextViewClass self => self -> IO Int
- textViewSetRightMargin :: TextViewClass self => self -> Int -> IO ()
- textViewGetRightMargin :: TextViewClass self => self -> IO Int
- textViewSetIndent :: TextViewClass self => self -> Int -> IO ()
- textViewGetIndent :: TextViewClass self => self -> IO Int
- textViewGetDefaultAttributes :: TextViewClass self => self -> IO TextAttributes
- textViewGetVisibleRect :: TextViewClass self => self -> IO Rectangle
- textViewGetIterLocation :: TextViewClass self => self -> TextIter -> IO Rectangle
- textViewGetIterAtPosition :: TextViewClass self => self -> Int -> Int -> IO (TextIter, Int)
- textViewSetOverwrite :: TextViewClass self => self -> Bool -> IO ()
- textViewGetOverwrite :: TextViewClass self => self -> IO Bool
- textViewSetAcceptsTab :: TextViewClass self => self -> Bool -> IO ()
- textViewGetAcceptsTab :: TextViewClass self => self -> IO Bool
- textViewGetHadjustment :: TextViewClass self => self -> IO Adjustment
- textViewGetVadjustment :: TextViewClass self => self -> IO Adjustment
- textViewImContextFilterKeypress :: TextViewClass self => self -> EventM EKey Bool
- textViewResetImContext :: TextViewClass self => self -> IO ()
- textViewPixelsAboveLines :: TextViewClass self => Attr self Int
- textViewPixelsBelowLines :: TextViewClass self => Attr self Int
- textViewPixelsInsideWrap :: TextViewClass self => Attr self Int
- textViewEditable :: TextViewClass self => Attr self Bool
- textViewImModule :: TextViewClass self => Attr self DefaultGlibString
- textViewWrapMode :: TextViewClass self => Attr self WrapMode
- textViewJustification :: TextViewClass self => Attr self Justification
- textViewLeftMargin :: TextViewClass self => Attr self Int
- textViewRightMargin :: TextViewClass self => Attr self Int
- textViewIndent :: TextViewClass self => Attr self Int
- textViewCursorVisible :: TextViewClass self => Attr self Bool
- textViewBuffer :: TextViewClass self => Attr self TextBuffer
- textViewOverwrite :: TextViewClass self => Attr self Bool
- textViewAcceptsTab :: TextViewClass self => Attr self Bool
- backspace :: TextViewClass self => Signal self (IO ())
- copyClipboard :: TextViewClass self => Signal self (IO ())
- cutClipboard :: TextViewClass self => Signal self (IO ())
- deleteFromCursor :: TextViewClass self => Signal self (DeleteType -> Int -> IO ())
- insertAtCursor :: (TextViewClass self, GlibString string) => Signal self (string -> IO ())
- moveCursor :: TextViewClass self => Signal self (MovementStep -> Int -> Bool -> IO ())
- moveViewport :: TextViewClass self => Signal self (ScrollStep -> Int -> IO ())
- moveFocus :: TextViewClass self => Signal self (DirectionType -> IO ())
- pageHorizontally :: TextViewClass self => Signal self (Int -> Bool -> IO ())
- pasteClipboard :: TextViewClass self => Signal self (IO ())
- populatePopup :: TextViewClass self => Signal self (Menu -> IO ())
- selectAll :: TextViewClass self => Signal self (Bool -> IO ())
- setAnchor :: TextViewClass self => Signal self (IO ())
- setTextViewScrollAdjustments :: TextViewClass self => Signal self (Adjustment -> Adjustment -> IO ())
- toggleCursorVisible :: TextViewClass self => Signal self (IO ())
- toggleOverwrite :: TextViewClass self => Signal self (IO ())
- textViewPreeditChanged :: (TextViewClass self, GlibString string) => Signal self (string -> IO ())

# Detail

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

Throughout we distinguish between buffer coordinates which are pixels with the origin at the upper left corner of the first character on the first line. Window coordinates are relative to the top left pixel which is visible in the current `TextView`. Coordinates from Events are in the latter relation. The conversion can be done with `textViewWindowToBufferCoords`.

# Class Hierarchy

    | GObject
    | +----Object
    | +----Widget
    | +----Container
    | +----TextView
    |
    |
    | GObject
    | +----TextChildAnchor

# Types

data TextView Source #

#### Instances

Instances details

Eq TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: TextView -> TextView -> Bool Source # (/=) :: TextView -> TextView -> Bool Source #
Ord TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods compare :: TextView -> TextView -> Ordering Source # (<) :: TextView -> TextView -> Bool Source # (<=) :: TextView -> TextView -> Bool Source # (>) :: TextView -> TextView -> Bool Source # (>=) :: TextView -> TextView -> Bool Source # max :: TextView -> TextView -> TextView Source # min :: TextView -> TextView -> TextView Source #
GObjectClass TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: TextView -> GObject Source # unsafeCastGObject :: GObject -> TextView Source #
ContainerClass TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types
TextViewClass TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types
WidgetClass TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class ContainerClass o => TextViewClass o Source #

#### Instances

Instances details

TextViewClass TextView Source # |
Instance details Defined in Graphics.UI.Gtk.Types

data TextChildAnchor Source #

#### Instances

Instances details

Eq TextChildAnchor Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods (==) :: TextChildAnchor -> TextChildAnchor -> Bool Source # (/=) :: TextChildAnchor -> TextChildAnchor -> Bool Source #
Ord TextChildAnchor Source # |

Instance details

Defined in Graphics.UI.Gtk.Types

Methods

compare :: TextChildAnchor -> TextChildAnchor -> Ordering Source #

(<) :: TextChildAnchor -> TextChildAnchor -> Bool Source #

(<=) :: TextChildAnchor -> TextChildAnchor -> Bool Source #

(>) :: TextChildAnchor -> TextChildAnchor -> Bool Source #

(>=) :: TextChildAnchor -> TextChildAnchor -> Bool Source #

max :: TextChildAnchor -> TextChildAnchor -> TextChildAnchor Source #

min :: TextChildAnchor -> TextChildAnchor -> TextChildAnchor Source #

GObjectClass TextChildAnchor Source # |
Instance details Defined in Graphics.UI.Gtk.Types Methods toGObject :: TextChildAnchor -> GObject Source # unsafeCastGObject :: GObject -> TextChildAnchor Source #
TextChildAnchorClass TextChildAnchor Source # |
Instance details Defined in Graphics.UI.Gtk.Types

class GObjectClass o => TextChildAnchorClass o Source #

#### Instances

Instances details

TextChildAnchorClass TextChildAnchor Source # |
Instance details Defined in Graphics.UI.Gtk.Types

castToTextView :: GObjectClass obj => obj -> TextView Source #

gTypeTextView :: GType Source #

toTextView :: TextViewClass o => o -> TextView Source #

data DeleteType Source #

Editing option

Constructors

DeleteChars |
DeleteWordEnds |
DeleteWords |
DeleteDisplayLines |
DeleteDisplayLineEnds |
DeleteParagraphEnds |
DeleteParagraphs |
DeleteWhitespace |

#### Instances

Instances details

Enum DeleteType Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: DeleteType -> DeleteType Source #

pred :: DeleteType -> DeleteType Source #

toEnum :: Int -> DeleteType Source #

fromEnum :: DeleteType -> Int Source #

enumFrom :: DeleteType -> [DeleteType] Source #

enumFromThen :: DeleteType -> DeleteType -> [DeleteType] Source #

enumFromTo :: DeleteType -> DeleteType -> [DeleteType] Source #

enumFromThenTo :: DeleteType -> DeleteType -> DeleteType -> [DeleteType] Source #

Show DeleteType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> DeleteType -> ShowS Source # show :: DeleteType -> String Source # showList :: [DeleteType] -> ShowS Source #
Eq DeleteType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: DeleteType -> DeleteType -> Bool Source # (/=) :: DeleteType -> DeleteType -> Bool Source #

data DirectionType Source #

Editing direction

Constructors

DirTabForward |
DirTabBackward |
DirUp |
DirDown |
DirLeft |
DirRight |

#### Instances

Instances details

Enum DirectionType Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: DirectionType -> DirectionType Source #

pred :: DirectionType -> DirectionType Source #

toEnum :: Int -> DirectionType Source #

fromEnum :: DirectionType -> Int Source #

enumFrom :: DirectionType -> [DirectionType] Source #

enumFromThen :: DirectionType -> DirectionType -> [DirectionType] Source #

enumFromTo :: DirectionType -> DirectionType -> [DirectionType] Source #

enumFromThenTo :: DirectionType -> DirectionType -> DirectionType -> [DirectionType] Source #

Show DirectionType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> DirectionType -> ShowS Source # show :: DirectionType -> String Source # showList :: [DirectionType] -> ShowS Source #
Eq DirectionType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: DirectionType -> DirectionType -> Bool Source # (/=) :: DirectionType -> DirectionType -> Bool Source #

data Justification Source #

Justification for label and maybe other widgets (text?)

Constructors

JustifyLeft |
JustifyRight |
JustifyCenter |
JustifyFill |

#### Instances

Instances details

Enum Justification Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: Justification -> Justification Source #

pred :: Justification -> Justification Source #

toEnum :: Int -> Justification Source #

fromEnum :: Justification -> Int Source #

enumFrom :: Justification -> [Justification] Source #

enumFromThen :: Justification -> Justification -> [Justification] Source #

enumFromTo :: Justification -> Justification -> [Justification] Source #

enumFromThenTo :: Justification -> Justification -> Justification -> [Justification] Source #

Show Justification Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> Justification -> ShowS Source # show :: Justification -> String Source # showList :: [Justification] -> ShowS Source #
Eq Justification Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: Justification -> Justification -> Bool Source # (/=) :: Justification -> Justification -> Bool Source #

data MovementStep Source #

Movement in text widget

Constructors

MovementLogicalPositions |
MovementVisualPositions |
MovementWords |
MovementDisplayLines |
MovementDisplayLineEnds |
MovementParagraphs |
MovementParagraphEnds |
MovementPages |
MovementBufferEnds |
MovementHorizontalPages |

#### Instances

Instances details

Enum MovementStep Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: MovementStep -> MovementStep Source #

pred :: MovementStep -> MovementStep Source #

toEnum :: Int -> MovementStep Source #

fromEnum :: MovementStep -> Int Source #

enumFrom :: MovementStep -> [MovementStep] Source #

enumFromThen :: MovementStep -> MovementStep -> [MovementStep] Source #

enumFromTo :: MovementStep -> MovementStep -> [MovementStep] Source #

enumFromThenTo :: MovementStep -> MovementStep -> MovementStep -> [MovementStep] Source #

Show MovementStep Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> MovementStep -> ShowS Source # show :: MovementStep -> String Source # showList :: [MovementStep] -> ShowS Source #
Eq MovementStep Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: MovementStep -> MovementStep -> Bool Source # (/=) :: MovementStep -> MovementStep -> Bool Source #

data TextWindowType Source #

Constructors

TextWindowPrivate |
TextWindowWidget |
TextWindowText |
TextWindowLeft |
TextWindowRight |
TextWindowTop |
TextWindowBottom |

#### Instances

Instances details

Enum TextWindowType Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: TextWindowType -> TextWindowType Source #

pred :: TextWindowType -> TextWindowType Source #

toEnum :: Int -> TextWindowType Source #

fromEnum :: TextWindowType -> Int Source #

enumFrom :: TextWindowType -> [TextWindowType] Source #

enumFromThen :: TextWindowType -> TextWindowType -> [TextWindowType] Source #

enumFromTo :: TextWindowType -> TextWindowType -> [TextWindowType] Source #

enumFromThenTo :: TextWindowType -> TextWindowType -> TextWindowType -> [TextWindowType] Source #

Show TextWindowType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> TextWindowType -> ShowS Source # show :: TextWindowType -> String Source # showList :: [TextWindowType] -> ShowS Source #
Eq TextWindowType Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: TextWindowType -> TextWindowType -> Bool Source # (/=) :: TextWindowType -> TextWindowType -> Bool Source #

data WrapMode Source #

Determine how lines are wrapped in a `TextView`.

Constructors

WrapNone |
WrapChar |
WrapWord |
WrapWordChar |

#### Instances

Instances details

Enum WrapMode Source # |

Instance details

Defined in Graphics.UI.Gtk.General.Enums

Methods

succ :: WrapMode -> WrapMode Source #

pred :: WrapMode -> WrapMode Source #

toEnum :: Int -> WrapMode Source #

fromEnum :: WrapMode -> Int Source #

enumFrom :: WrapMode -> [WrapMode] Source #

enumFromThen :: WrapMode -> WrapMode -> [WrapMode] Source #

enumFromTo :: WrapMode -> WrapMode -> [WrapMode] Source #

enumFromThenTo :: WrapMode -> WrapMode -> WrapMode -> [WrapMode] Source #

Show WrapMode Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods showsPrec :: Int -> WrapMode -> ShowS Source # show :: WrapMode -> String Source # showList :: [WrapMode] -> ShowS Source #
Eq WrapMode Source # |
Instance details Defined in Graphics.UI.Gtk.General.Enums Methods (==) :: WrapMode -> WrapMode -> Bool Source # (/=) :: WrapMode -> WrapMode -> Bool Source #

# Constructors

textViewNew :: IO TextView Source #

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

textViewNewWithBuffer :: TextBufferClass buffer => buffer -> IO TextView Source #

Creates a new `TextView` widget displaying the buffer `buffer`. One buffer can be shared among many widgets.

# Methods

textViewSetBuffer :: (TextViewClass self, TextBufferClass buffer) => self -> buffer -> IO () Source #

Sets the given buffer as the buffer being displayed by the text view.

textViewGetBuffer :: TextViewClass self => self -> IO TextBuffer Source #

Returns the `TextBuffer` being displayed by this text view.

textViewScrollToMark Source #

Arguments

:: (TextViewClass self, TextMarkClass mark) |
=> self |
-> mark | `mark` - a `TextMark`
-> Double | `withinMargin` - margin as a [0.0,0.5) fraction of screen size and imposes an extra margin at all four sides of the window within which `xalign` and `yalign` are evaluated.
-> Maybe (Double, Double) | `Just (xalign, yalign)` - horizontal and vertical alignment of mark within visible area (if `Nothing`, scroll just enough to get the mark onscreen)
-> IO () |

Scrolls the text view 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 the alignment is `Nothing`, 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`.

textViewScrollToIter Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> Double | `withinMargin` - margin as a [0.0,0.5) fraction of screen size
-> Maybe (Double, Double) | `Just (xalign, yalign)` - horizontal and vertical alignment of mark within visible area (if `Nothing`, scroll just enough to get the iterator onscreen)
-> IO Bool | returns `True` if scrolling occurred

Scrolls the text view 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 the alignment is `Nothing`, 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`.

- This function uses the currently-computed height of the lines in the text buffer. Note that 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. This is particularly important if you add new text to the buffer and immediately ask the view to scroll to it (which it can't since it is not updated until the main loop runs).

textViewScrollMarkOnscreen Source #

Arguments

:: (TextViewClass self, TextMarkClass mark) |
=> self |
-> mark | `mark` - a mark in the buffer for the text view
-> IO () |

Scrolls the text view the minimum distance such that `mark` is contained within the visible area of the widget.

textViewMoveMarkOnscreen Source #

Arguments

:: (TextViewClass self, TextMarkClass mark) |
=> self |
-> mark | `mark` - a `TextMark`
-> IO 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.

textViewPlaceCursorOnscreen Source #

Arguments

:: TextViewClass self |
=> self |
-> IO 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.

textViewGetLineAtY Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `y` - a y coordinate
-> IO (TextIter, Int) | `(targetIter, lineTop)` - returns the iter and the top coordinate of the line

Gets the `TextIter` at the start of the line containing the coordinate `y`. `y` is in buffer coordinates, convert from window coordinates with `textViewWindowToBufferCoords`. Also returns `lineTop` the coordinate of the top edge of the line.

textViewGetLineYrange Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO (Int, Int) | `(y, height)` - y coordinate and height of the line

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

textViewGetIterAtLocation Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `x` - x position, in buffer coordinates
-> Int | `y` - y position, in buffer coordinates
-> IO TextIter |

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

textViewBufferToWindowCoords Source #

Arguments

:: TextViewClass self |
=> self |
-> TextWindowType | `win` - a `TextWindowType` except `TextWindowPrivate`
-> (Int, Int) | `(bufferX, bufferY)` - buffer x and y coordinates
-> IO (Int, Int) | returns window x and y coordinates

Converts coordinate `(bufferX, bufferY)` to coordinates for the window `win`

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

textViewWindowToBufferCoords Source #

Arguments

:: TextViewClass self |
=> self |
-> TextWindowType | `win` - a `TextWindowType` except `TextWindowPrivate`
-> (Int, Int) | `(windowX, windowY)` - window x and y coordinates
-> IO (Int, Int) | returns buffer x and y coordinates

Converts coordinates on the window identified by `win` to buffer coordinates.

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

textViewGetWindow Source #

Arguments

:: TextViewClass self |
=> self |
-> TextWindowType | `win` - window to get
-> IO (Maybe DrawWindow) | returns a `DrawWindow`, or `Nothing`

Retrieves the `DrawWindow` 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.

textViewGetWindowType :: TextViewClass self => self -> DrawWindow -> IO TextWindowType Source #

Retrieve the type of window the `TextView` widget contains.

Usually used to find out which window an event corresponds to. An emission of an event signal of `TextView` yields a `DrawWindow`. This function can be used to see if the event actually belongs to the main text window.

textViewSetBorderWindowSize Source #

Arguments

:: TextViewClass self |
=> self |
-> TextWindowType | `type` - window to affect
-> Int | `size` - width or height of the window
-> IO () |

Sets the width of `TextWindowLeft` or `TextWindowRight`, or the height of `TextWindowTop` or `TextWindowBottom`. 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 `TextWindowWidget`, `TextWindowText`, or `TextWindowPrivate`.

textViewGetBorderWindowSize Source #

Arguments

:: TextViewClass self |
=> self |
-> TextWindowType | `type` - window to return size from
-> IO Int | returns width of window

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

textViewForwardDisplayLine Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO 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`.

textViewBackwardDisplayLine Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO 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`.

textViewForwardDisplayLineEnd Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO 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`.

textViewBackwardDisplayLineStart Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO 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`.

textViewStartsDisplayLine Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> IO 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.

textViewMoveVisually Source #

Arguments

:: TextViewClass self |
=> self |
-> TextIter | `iter` - a `TextIter`
-> Int | `count` - number of characters to move (negative moves left, positive moves right)
-> IO 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 bidirection 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.

textViewAddChildAtAnchor Source #

Arguments

:: (TextViewClass self, WidgetClass child) |
=> self |
-> child | `child` - a `Widget`
-> TextChildAnchor | `anchor` - a `TextChildAnchor` in the `TextBuffer` for the text view
-> IO () |

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

textChildAnchorNew :: IO TextChildAnchor Source #

Create a new `TextChildAnchor`.

- Using `textBufferCreateChildAnchor` is usually simpler then executing this function and `textBufferInsertChildAnchor`.

textChildAnchorGetWidgets :: TextChildAnchor -> IO [Widget] Source #

Retrieve all `Widget`s at this `TextChildAnchor`.

- The widgets in the returned list need to be upcasted to what they were.

textChildAnchorGetDeleted :: TextChildAnchor -> IO Bool Source #

Query if an anchor was deleted.

textViewAddChildInWindow Source #

Arguments

:: (TextViewClass self, WidgetClass child) |
=> self |
-> child | `child` - a `Widget`
-> TextWindowType | `whichWindow` - which window the child should appear in
-> Int | `xpos` - X position of child in window coordinates
-> Int | `ypos` - Y position of child in window coordinates
-> IO () |

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 the `DrawWindow` in question, and that these coordinates have no sane relationship to scrolling. When placing a child in `TextWindowWidget`, scrolling is irrelevant, the child floats above all scrollable areas. If you want the widget to move when the text view scrolls, use `textViewAddChildAtAnchor` instead.

textViewMoveChild Source #

Arguments

:: (TextViewClass self, WidgetClass child) |
=> self |
-> child | `child` - child widget already added to the text view
-> Int | `xpos` - new X position in window coordinates
-> Int | `ypos` - new Y position in window coordinates
-> IO () |

Move a child widget within the `TextView`. This is really only appropriate for "floating" child widgets added using `textViewAddChildInWindow`.

textViewSetWrapMode :: TextViewClass self => self -> WrapMode -> IO () Source #

Sets the line wrapping for the view.

textViewGetWrapMode :: TextViewClass self => self -> IO WrapMode Source #

Gets the line wrapping for the view.

textViewSetEditable :: TextViewClass self => self -> Bool -> IO () Source #

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

textViewGetEditable :: TextViewClass self => self -> IO Bool Source #

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

textViewSetCursorVisible :: TextViewClass self => self -> Bool -> IO () Source #

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

textViewGetCursorVisible :: TextViewClass self => self -> IO Bool Source #

Find out whether the cursor is being displayed.

textViewSetPixelsAboveLines :: TextViewClass self => self -> Int -> IO () Source #

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

- Tags in the buffer may override this default.

textViewGetPixelsAboveLines :: TextViewClass self => self -> IO Int Source #

Gets the default number of pixels to put above paragraphs.

textViewSetPixelsBelowLines :: TextViewClass self => self -> Int -> IO () Source #

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

textViewGetPixelsBelowLines :: TextViewClass self => self -> IO Int Source #

Gets the default number of blank pixels below each paragraph.

textViewSetPixelsInsideWrap :: TextViewClass self => self -> Int -> IO () Source #

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

textViewGetPixelsInsideWrap :: TextViewClass self => self -> IO Int Source #

Gets the default number of pixels of blank space between lines in a wrapped paragraph.

textViewSetJustification :: TextViewClass self => self -> Justification -> IO () Source #

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

textViewGetJustification :: TextViewClass self => self -> IO Justification Source #

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

textViewSetLeftMargin Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `leftMargin` - left margin in pixels
-> IO () |

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

textViewGetLeftMargin Source #

Arguments

:: TextViewClass self |
=> self |
-> IO Int | returns left margin in pixels

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

textViewSetRightMargin Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `rightMargin` - right margin in pixels
-> IO () |

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

textViewGetRightMargin Source #

Arguments

:: TextViewClass self |
=> self |
-> IO Int | returns right margin in pixels

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

textViewSetIndent Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `indent` - indentation in pixels (may be negative)
-> IO () |

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

textViewGetIndent Source #

Arguments

:: TextViewClass self |
=> self |
-> IO Int | returns number of pixels of indentation

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

textViewGetDefaultAttributes :: TextViewClass self => self -> IO TextAttributes Source #

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.

textViewGetVisibleRect :: TextViewClass self => self -> IO Rectangle Source #

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

textViewGetIterLocation :: TextViewClass self => self -> TextIter -> IO Rectangle Source #

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.

textViewGetIterAtPosition Source #

Arguments

:: TextViewClass self |
=> self |
-> Int | `x` - x position, in buffer coordinates
-> Int | `y` - y position, in buffer coordinates
-> IO (TextIter, Int) | `(iter, trailing)` - returns the iterator and an integer indicating where in the grapheme the user clicked. It will either be zero, or the number of characters in the grapheme. 0 represents the trailing edge of the grapheme.

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.

- Available since Gtk+ version 2.6

textViewSetOverwrite Source #

Arguments

:: TextViewClass self |
=> self |
-> Bool | `overwrite` - `True` to turn on overwrite mode, `False` to turn it off
-> IO () |

Changes the `TextView` overwrite mode.

- Available since Gtk+ version 2.4

textViewGetOverwrite :: TextViewClass self => self -> IO Bool Source #

Returns whether the `TextView` is in overwrite mode or not.

- Available since Gtk+ version 2.4

textViewSetAcceptsTab Source #

Arguments

:: TextViewClass self |
=> self |
-> Bool | `acceptsTab` - `True` if pressing the Tab key should insert a tab character, `False`, if pressing the Tab key should move the keyboard focus.
-> IO () |

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.

- Available since Gtk+ version 2.4

textViewGetAcceptsTab Source #

Arguments

:: TextViewClass self |
=> self |
-> IO 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`.

- Available since Gtk+ version 2.4

textViewGetHadjustment :: TextViewClass self => self -> IO Adjustment Source #

Gets the horizontal-scrolling `Adjustment`.

- Available since Gtk+ version 2.22

textViewGetVadjustment :: TextViewClass self => self -> IO Adjustment Source #

Gets the vertical-scrolling `Adjustment`.

- Available since Gtk+ version 2.22

textViewImContextFilterKeypress :: TextViewClass self => self -> EventM EKey Bool Source #

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

- Available since Gtk+ version 2.22

textViewResetImContext :: TextViewClass self => self -> IO () Source #

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.

- Available since Gtk+ version 2.22

# Attributes

textViewPixelsAboveLines :: TextViewClass self => Attr self Int Source #

Pixels of blank space above paragraphs.

Allowed values: >= 0

Default value: 0

textViewPixelsBelowLines :: TextViewClass self => Attr self Int Source #

Pixels of blank space below paragraphs.

Allowed values: >= 0

Default value: 0

textViewPixelsInsideWrap :: TextViewClass self => Attr self Int Source #

Pixels of blank space between wrapped lines in a paragraph.

Allowed values: >= 0

Default value: 0

textViewEditable :: TextViewClass self => Attr self Bool Source #

Whether the text can be modified by the user.

Default value: `True`

textViewImModule :: TextViewClass self => Attr self DefaultGlibString Source #

Which IM (input method) module should be used for this entry. See GtkIMContext. Setting this to a non-empty value overrides the system-wide IM module setting. See the GtkSettings "gtk-im-module" property.

Default value: ""

textViewWrapMode :: TextViewClass self => Attr self WrapMode Source #

Whether to wrap lines never, at word boundaries, or at character boundaries.

Default value: `WrapNone`

textViewJustification :: TextViewClass self => Attr self Justification Source #

Left, right, or center justification.

Default value: `JustifyLeft`

textViewLeftMargin :: TextViewClass self => Attr self Int Source #

Width of the left margin in pixels.

Allowed values: >= 0

Default value: 0

textViewRightMargin :: TextViewClass self => Attr self Int Source #

Width of the right margin in pixels.

Allowed values: >= 0

Default value: 0

textViewIndent :: TextViewClass self => Attr self Int Source #

Amount to indent the paragraph, in pixels.

Allowed values: >= 0

Default value: 0

textViewCursorVisible :: TextViewClass self => Attr self Bool Source #

If the insertion cursor is shown.

Default value: `True`

textViewBuffer :: TextViewClass self => Attr self TextBuffer Source #

The buffer which is displayed.

textViewOverwrite :: TextViewClass self => Attr self Bool Source #

Whether entered text overwrites existing contents.

Default value: `False`

textViewAcceptsTab :: TextViewClass self => Attr self Bool Source #

Whether Tab will result in a tab character being entered.

Default value: `True`

# Signals

backspace :: TextViewClass self => Signal self (IO ()) Source #

The `backspace` signal is a keybinding signal which gets emitted when the user asks for it.

The default bindings for this signal are Backspace and Shift-Backspace.

copyClipboard :: TextViewClass self => Signal self (IO ()) Source #

Copying to the clipboard.

- This signal is emitted when a selection is copied to the clipboard.
- The action itself happens when the `TextView` processes this signal.

cutClipboard :: TextViewClass self => Signal self (IO ()) Source #

Cutting to the clipboard.

- This signal is emitted when a selection is cut out and copied to the clipboard. The action itself happens when the textview processed this request.

deleteFromCursor :: TextViewClass self => Signal self (DeleteType -> Int -> IO ()) Source #

Deleting text.

- The widget will remove the specified number of units in the text where the meaning of units depends on the kind of deletion.
- The action itself happens when the `TextView` processes this signal.

insertAtCursor :: (TextViewClass self, GlibString string) => Signal self (string -> IO ()) Source #

Inserting text.

- The widget will insert the string into the text where the meaning of units depends on the kind of deletion.
- The action itself happens when the `TextView` processes this signal.

moveCursor :: TextViewClass self => Signal self (MovementStep -> Int -> Bool -> IO ()) Source #

Moving the cursor.

- The signal specifies what kind and how many steps the cursor will do. The flag is set to `True` if this movement extends a selection.
- The action itself happens when the `TextView` processes this signal.

moveViewport :: TextViewClass self => Signal self (ScrollStep -> Int -> IO ()) Source #

The `moveViewport` signal is a keybinding signal which can be bound to key combinations to allow the user to move the viewport, i.e. change what part of the text view is visible in a containing scrolled window. There are no default bindings for this signal.

moveFocus :: TextViewClass self => Signal self (DirectionType -> IO ()) Source #

Moving the focus.

- The action itself happens when the `TextView` processes this signal.

pageHorizontally :: TextViewClass self => Signal self (Int -> Bool -> IO ()) Source #

Page change signals.

- The signal specifies how many pages the view should move up or down. The flag is set to `True` if this movement extends a selection.
- The action itself happens when the `TextView` processes this signal.
- Figure out why this signal is called horizontally, not vertically.

pasteClipboard :: TextViewClass self => Signal self (IO ()) Source #

Pasting from the clipboard.

- This signal is emitted when something is pasted from the clipboard.
- The action itself happens when the `TextView` processes this signal.

populatePopup :: TextViewClass self => Signal self (Menu -> IO ()) Source #

Add menu entries to context menus.

- This signal is emitted if a context menu within the `TextView` is opened. This signal can be used to add application specific menu items to this popup.

selectAll :: TextViewClass self => Signal self (Bool -> IO ()) Source #

Inserting an anchor.

- This signal is emitted when anchor is inserted into the text.
- The action itself happens when the `TextView` processes this signal.

setAnchor :: TextViewClass self => Signal self (IO ()) Source #

The scroll-bars changed.

setTextViewScrollAdjustments :: TextViewClass self => Signal self (Adjustment -> Adjustment -> IO ()) Source #

The `setTextViewScrollAdjustments` signal is a keybinding signal which gets emitted to toggle the visibility of the cursor. The default binding for this signal is F7.

toggleCursorVisible :: TextViewClass self => Signal self (IO ()) Source #

The `toggleCursorVisible` signal is a keybinding signal which gets emitted to toggle the visibility of the cursor. The default binding for this signal is F7.

toggleOverwrite :: TextViewClass self => Signal self (IO ()) Source #

Insert Overwrite mode has changed.

- This signal is emitted when the `TextView` changes from inserting mode to overwriting mode and vice versa.
- The action itself happens when the `TextView` processes this signal.

textViewPreeditChanged :: (TextViewClass self, GlibString string) => Signal self (string -> IO ()) Source #

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.

This signal is only emitted if the text at the given position is actually editable.