Name

TextView —

Synopsis

textChildAnchorNew:: IO TextChildAnchor
textViewNew:: IO TextView
textChildAnchorGetDeleted:: TextChildAnchor -> IO Bool
textChildAnchorGetWidgets:: TextChildAnchor -> IO [Widget]
textViewAddChildAtAnchor:: (TextViewClass tv, WidgetClass w) => tv -> w -> TextChildAnchor -> IO ()
textViewAddChildInWindow:: (TextViewClass tv, WidgetClass w) => tv -> w -> TextWindowType -> Int -> Int -> IO ()
textViewBackwardDisplayLine:: TextViewClass tv => tv -> TextIter -> IO Bool
textViewBackwardDisplayLineEnd:: TextViewClass tv => tv -> TextIter -> IO Bool
textViewBackwardDisplayLineStart:: TextViewClass tv => tv -> TextIter -> IO Bool
textViewBufferToWindowCoords:: TextViewClass tv => tv -> TextWindowType -> (Int,Int) -> IO (Int,Int)
textViewForwardDisplayLine:: TextViewClass tv => tv -> TextIter -> IO Bool
textViewForwardDisplayLineEnd:: TextViewClass tv => TextIter -> tv -> IO Bool
textViewForwardDisplayLineStart:: TextViewClass tv => tv -> TextIter -> IO Bool
textViewGetBorderWindowSize:: TextViewClass tv => tv -> TextWindowType -> IO Int
textViewGetCursorVisible:: TextViewClass tv => tv -> IO Bool
textViewGetEditable:: TextViewClass tv => tv -> IO Bool
textViewGetIndent:: TextViewClass tv => tv -> IO Int
textViewGetIterAtLocation:: TextViewClass tv => tv -> Int -> Int -> IO TextIter
textViewGetIterLocation:: TextViewClass tv => tv -> TextIter -> IO Rectangle
textViewGetJustification:: TextViewClass tv => tv -> IO Justification
textViewGetLeftMargin:: TextViewClass tv => tv -> IO Int
textViewGetLineAtY:: TextViewClass tv => tv -> Int -> IO (TextIter,Int)
textViewGetLineYrange:: TextViewClass tv => tv -> TextIter -> IO (Int,Int)
textViewGetPixelsAboveLines:: TextViewClass tv => tv -> IO Int
textViewGetPixelsBelowLines:: TextViewClass tv => tv -> IO Int
textViewGetPixelsInsideWrap:: TextViewClass tv => tv -> IO Int
textViewGetRightMargin:: TextViewClass tv => tv -> IO Int
textViewGetVisibleRect:: TextViewClass tv => tv -> IO Rectangle
textViewGetWindow:: TextViewClass tv => tv -> TextWindowType -> IO (Maybe DrawWindow)
textViewGetWindowType:: TextViewClass tv => tv -> DrawWindow -> IO TextWindowType
textViewGetWrapMode:: TextViewClass tv => tv -> IO WrapMode
textViewMoveChild:: (TextViewClass tv, WidgetClass w) => tv -> w -> Int -> Int -> IO ()
textViewMoveMarkOnscreen:: TextViewClass tv => tv -> TextMark -> IO Bool
textViewMoveVisually:: TextViewClass tv => tv -> TextIter -> Int -> IO Bool
textViewNewWithBuffer:: TextBuffer -> IO TextView
textViewPlaceCursorOnscreen:: TextViewClass tv => tv -> IO Bool
textViewScrollMarkOnscreen:: TextViewClass tv => tv -> TextMark -> IO ()
textViewScrollToIter:: TextViewClass tv => tv -> TextIter -> Double -> Maybe (Double,Double) -> IO Bool
textViewScrollToMark:: TextViewClass tv => tv -> TextMark -> Double -> Maybe (Double,Double) -> IO ()
textViewSetBorderWindowSize:: TextViewClass tv => tv -> TextWindowType -> Int -> IO ()
textViewSetBuffer:: TextViewClass tv => tv -> TextBuffer -> IO ()
textViewSetCursorVisible:: TextViewClass tv => tv -> Bool -> IO ()
textViewSetEditable:: TextViewClass tv => tv -> Bool -> IO ()
textViewSetIndent:: TextViewClass tv => tv -> Int -> IO ()
textViewSetJustification:: TextViewClass tv => tv -> Justification -> IO ()
textViewSetLeftMargin:: TextViewClass tv => tv -> Int -> IO ()
textViewSetPixelsAboveLines:: TextViewClass tv => tv -> Int -> IO ()
textViewSetPixelsBelowLines:: TextViewClass tv => tv -> Int -> IO ()
textViewSetPixelsInsideWrap:: TextViewClass tv => tv -> Int -> IO ()
textViewSetRightMargin:: TextViewClass tv => tv -> Int -> IO ()
textViewSetWrapMode:: TextViewClass tv => tv -> WrapMode -> IO ()
textViewWindowToBufferCoords:: TextViewClass tv => tv -> TextWindowType -> (Int,Int) -> IO (Int,Int)
onCopyClipboard:: TextViewClass tv => tv -> IO () -> IO (ConnectId tv)
onCutClipboard:: TextViewClass tv => tv -> IO () -> IO (ConnectId tv)
onDeleteFromCursor:: TextViewClass tv => tv -> (DeleteType -> Int -> IO ()) -> IO (ConnectId tv)
onInsertAtCursor:: TextViewClass tv => tv -> (String -> IO ()) -> IO (ConnectId tv)
onMoveCursor:: TextViewClass tv => tv -> (MovementStep -> Int -> Bool -> IO ()) -> IO (ConnectId tv)
onMoveFocus:: TextViewClass tv => tv -> (DirectionType -> IO ()) -> IO (ConnectId tv)
onPageHorizontally:: TextViewClass tv => tv -> (Int -> Bool -> IO ()) -> IO (ConnectId tv)
onPasteClipboard:: TextViewClass tv => tv -> IO () -> IO (ConnectId tv)
onPopulatePopup:: TextViewClass tv => tv -> (Menu -> IO ()) -> IO (ConnectId tv)
onSetAnchor:: TextViewClass tv => tv -> IO () -> IO (ConnectId tv)
onSetScrollAdjustments:: TextViewClass tv => tv -> (Adjustment -> Adjustment -> IO ()) -> IO (ConnectId tv)
onToggleOverwrite:: TextViewClass tv => tv -> IO () -> IO (ConnectId tv)

Introduction

Through out we distinguish between buffer cooridinates 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.

Todo

If PangoTabArray is bound: do textViewSetTabs and textViewGetTabs

If TextTags are bound: do textViewGetDefaultAttributes

Constructors

textChildAnchorNew

Create a new TextChildAnchor.

textChildAnchorNew

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

textViewNew

Create a new TextView widget with a default TextBuffer.

textViewNew

Methods

textChildAnchorGetDeleted

Query if an anchor was deleted.

textChildAnchorGetDeleted:: TextChildAnchor:: IO Bool
tca

textChildAnchorGetWidgets

Retrieve all Widgets at this TextChildAnchor.

textChildAnchorGetWidgets:: TextChildAnchor:: IO [Widget]
tca

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

textViewAddChildAtAnchor

Add a child widget in the TextBuffer at a given TextChildAnchor.

textViewAddChildAtAnchor:: tv:: w:: TextChildAnchor:: IO ()
tvwanchor

textViewAddChildInWindow

Place a widget in within the text.

textViewAddChildInWindow:: tv:: w:: TextWindowType:: Int:: Int:: IO ()
tvwtwtxy

This function places a Widget at an absolute pixel position into the TextView. Note that any scrolling will leave the widget in the same spot as it was.

The position x, y is relative to the DrawWindow specified by TextWindowType.

textViewBackwardDisplayLine

Move the iterator backwards by one display line.

textViewBackwardDisplayLine:: tv:: TextIter:: IO Bool
tvti

See textViewForwardDisplayLine.

textViewBackwardDisplayLineEnd

Move the iterator backwards and to the end.

textViewBackwardDisplayLineEnd:: tv:: TextIter:: IO Bool
tvti

See textViewForwardDisplayLineEnd.

textViewBackwardDisplayLineStart

Move the iterator backwards and to the start.

textViewBackwardDisplayLineStart:: tv:: TextIter:: IO Bool
tvti

See textViewForwardDisplayLineStart.

textViewBufferToWindowCoords

Convert buffer cooridnates into window coordinates.

textViewBufferToWindowCoords:: tv:: TextWindowType:: (Int,Int):: IO (Int,Int)
tvwt(x, y)

textViewForwardDisplayLine

Move the iterator forwards by one display line.

textViewForwardDisplayLine:: tv:: TextIter:: IO Bool
tvti

Moves the given TextIter 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.

textViewForwardDisplayLineEnd

Move the iterator forwards and to the end.

textViewForwardDisplayLineEnd:: TextIter:: tv:: IO Bool
titv

Like textViewForwardDisplayLine but moves to the end of the line as well.

textViewForwardDisplayLineStart

Move the iterator forwards and to the start.

textViewForwardDisplayLineStart:: tv:: TextIter:: IO Bool
tvti

Like textViewForwardDisplayLine but moves to the start of the line as well.

textViewGetBorderWindowSize

Retrieve the border width of the specified window.

textViewGetBorderWindowSize:: tv:: TextWindowType:: IO Int
tvwt

See textViewSetBorderWindowSize.

textViewGetCursorVisible

Retrieve information whether the cursor in a TextView is visible or not.

textViewGetCursorVisible:: tv:: IO Bool
tv

textViewGetEditable

Retrieve information whether a TextView is editable or not.

textViewGetEditable:: tv:: IO Bool
tv

textViewGetIndent

Get the indentation in pixels for the first line in a paragraph.

textViewGetIndent:: tv:: IO Int
tv

Tags in the buffer may override this default.

The indentation may be negative.

textViewGetIterAtLocation

Retrieves the TextIter at buffer coordinates x and y.

textViewGetIterAtLocation:: tv:: Int:: Int:: IO TextIter
tvxy

textViewGetIterLocation

Get a rectangle that roughly contains the character at TextIter.

textViewGetIterLocation:: tv:: TextIter:: IO Rectangle
tvtm

Use textViewBufferToWindowCoords to convert into window cooridnates.

textViewGetJustification

Query how text is wrapped.

textViewGetJustification:: tv:: IO Justification
tv

textViewGetLeftMargin

Get the number of pixels in the margin.

textViewGetLeftMargin:: tv:: IO Int
tv

Tags in the buffer may override this default.

textViewGetLineAtY

Get the TextIter at the start of the line containing the coordinate y.

textViewGetLineAtY:: tv:: Int:: IO (TextIter,Int)
tvy

y is in buffer coordinates.

Returns the TextIter and the top of the line.

textViewGetLineYrange

Get the y coordinate of the top and the height of the line TextIter is on.

textViewGetLineYrange:: tv:: TextIter:: IO (Int,Int)
tvti

textViewGetPixelsAboveLines

Get the number of pixels above each paragraph.

textViewGetPixelsAboveLines:: tv:: IO Int
tv

Tags in the buffer may override this default.

textViewGetPixelsBelowLines

Get the number of pixels below each paragraph.

textViewGetPixelsBelowLines:: tv:: IO Int
tv

Tags in the buffer may override this default.

textViewGetPixelsInsideWrap

Get the number of pixels between lines inside a wraped paragraph.

textViewGetPixelsInsideWrap:: tv:: IO Int
tv

Tags in the buffer may override this default.

textViewGetRightMargin

Get the number of pixels in the margin.

textViewGetRightMargin:: tv:: IO Int
tv

Tags in the buffer may override this default.

textViewGetVisibleRect

Get the currently visible rectangle.

textViewGetVisibleRect:: tv:: IO Rectangle
tv

Use textViewBufferToWindowCoords to convert into window coordinates.

textViewGetWindow

Get the underlying DrawWindow.

textViewGetWindow:: tv:: TextWindowType:: IO (Maybe DrawWindow)
tvwt

The TextWindowType determines which window of the TextWidget we would like to receive.

Returns Nothing if there is no DrawWindow of the specified type.

textViewGetWindowType

Retrieve the type of window the TextView widget contains.

textViewGetWindowType:: tv:: DrawWindow:: IO TextWindowType
tvwin

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.

textViewGetWrapMode

Query how text is wrapped.

textViewGetWrapMode:: tv:: IO WrapMode
tv

textViewMoveChild

Move a child widget within the TextView.

textViewMoveChild:: tv:: w:: Int:: Int:: IO ()
tvwxy

textViewMoveMarkOnscreen

Move a TextMark within the buffer until it is in the currently visible area of the widget.

textViewMoveMarkOnscreen:: tv:: TextMark:: IO Bool
tvtm

Returns True if the Mark was moved.

textViewMoveVisually

Move the iterator a number of lines.

textViewMoveVisually:: tv:: TextIter:: Int:: IO Bool
tvticount

count is in display lines. See textViewForwardDisplayLine.

textViewNewWithBuffer

Create a new TextView widget with the given TextBuffer.

textViewNewWithBuffer:: TextBuffer:: IO TextView
tb

textViewPlaceCursorOnscreen

Move the cursor within the buffer until it is in the currently visible area of the widget.

textViewPlaceCursorOnscreen:: tv:: IO Bool
tv

Returns True if the Mark was moved.

textViewScrollMarkOnscreen

Scroll the visible area of the widget so the TextMark becomes visible.

textViewScrollMarkOnscreen:: tv:: TextMark:: IO ()
tvtm

This call is equivalent to textViewScrollToMark tm 0.0 Nothing tv.

textViewScrollToIter

Scroll to the position of the supplied TextIter.

textViewScrollToIter:: tv:: TextIter:: Double:: Maybe (Double,Double):: IO Bool
tvtiwithinMarginNothing
tvtiwithinMargin(Just (xalign, yalign))

The position might not be correct due to the delayed calculation of the line heights.

Returns True if the function actually scrolled.

textViewScrollToMark

Scroll to the position of the supplied TextMark.

textViewScrollToMark:: tv:: TextMark:: Double:: Maybe (Double,Double):: IO ()
tvtmwithinMarginNothing
tvtmwithinMargin(Just (xalign, yalign))

Supplying xalign, yalign gives a goal position of the TextMark within screen bounds. 0,0 means left, top and 1.0,1.0 means right, bottom.

Supply Nothing if the goal is to bring the position into view with the minimum of scrolling.

withinMargin is within [0.0 .. 0.5) and imposes an extra margin at all four sides of the window within which xalign and yalign are evaluated.

The line distances are calculated in an idle handler. Calling this function ensures that the line heights are indeed evaluated before the scroll is carried out.

textViewSetBorderWindowSize

Set the border width of the TextView widget.

textViewSetBorderWindowSize:: tv:: TextWindowType:: Int:: IO ()
tvwtsize

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 used with the four window types mentioned.

textViewSetBuffer

Set the TextBuffer for a given TextView widget.

textViewSetBuffer:: tv:: TextBuffer:: IO ()
tvtb

textViewSetCursorVisible

Toggle whether the cursor in the TextView is visible or not.

textViewSetCursorVisible:: tv:: Bool:: IO ()
tveditable

textViewSetEditable

Toggle whether the text in the TextView is editable or not.

textViewSetEditable:: tv:: Bool:: IO ()
tveditable

textViewSetIndent

Set the indentation in pixels for the first line in a paragraph.

textViewSetIndent:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

The indentation may be negative.

textViewSetJustification

Specify how to wrap text.

textViewSetJustification:: tv:: Justification:: IO ()
tvj

textViewSetLeftMargin

Set the number of pixels in the margin.

textViewSetLeftMargin:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

textViewSetPixelsAboveLines

Set the number of pixels above each paragraph.

textViewSetPixelsAboveLines:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

textViewSetPixelsBelowLines

Set the number of pixels below each paragraph.

textViewSetPixelsBelowLines:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

textViewSetPixelsInsideWrap

Set the number of pixels between lines inside a wraped paragraph.

textViewSetPixelsInsideWrap:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

textViewSetRightMargin

Set the number of pixels in the margin.

textViewSetRightMargin:: tv:: Int:: IO ()
tvp

Tags in the buffer may override this default.

textViewSetWrapMode

Specify how to wrap text.

textViewSetWrapMode:: tv:: WrapMode:: IO ()
tvwm

textViewWindowToBufferCoords

Convert window cooridnates into buffer coordinates.

textViewWindowToBufferCoords:: tv:: TextWindowType:: (Int,Int):: IO (Int,Int)
tvwt(x, y)

Signals

onCopyClipboard

Copying to the clipboard.

onCopyClipboard:: tv:: IO ():: IO (ConnectId tv)

This signal is emitted when a selection is copied to the clipboard.

The action itself happens when the TextView processes this signal.

onCutClipboard

Cutting to the clipboard.

onCutClipboard:: tv:: IO ():: IO (ConnectId tv)

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.

onDeleteFromCursor

Deleting text.

onDeleteFromCursor:: tv:: (DeleteType -> Int -> IO ()):: IO (ConnectId tv)

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.

onInsertAtCursor

Inserting text.

onInsertAtCursor:: tv:: (String -> IO ()):: IO (ConnectId tv)

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.

onMoveCursor

Moving the cursor.

onMoveCursor:: tv:: (MovementStep -> Int -> Bool -> IO ()):: IO (ConnectId tv)

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.

onMoveFocus

Moving the focus.

onMoveFocus:: tv:: (DirectionType -> IO ()):: IO (ConnectId tv)

The action itself happens when the TextView processes this signal.

onPageHorizontally

Page change signals.

onPageHorizontally:: tv:: (Int -> Bool -> IO ()):: IO (ConnectId tv)

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.

onPasteClipboard

Pasting from the clipboard.

onPasteClipboard:: tv:: IO ():: IO (ConnectId tv)

This signal is emitted when something is pasted from the clipboard.

The action itself happens when the TextView processes this signal.

onPopulatePopup

Add menu entries to context menus.

onPopulatePopup:: tv:: (Menu -> IO ()):: IO (ConnectId tv)

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.

onSetAnchor

Inserting an anchor.

onSetAnchor:: tv:: IO ():: IO (ConnectId tv)

This signal is emitted when anchor is inserted into the text.

The action itself happens when the TextView processes this signal.

onSetScrollAdjustments

The scroll-bars changed.

onSetScrollAdjustments:: tv:: (Adjustment -> Adjustment -> IO ()):: IO (ConnectId tv)

onToggleOverwrite

Insert/Overwrite mode has changed.

onToggleOverwrite:: tv:: IO ():: IO (ConnectId tv)

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.