textBufferNew:: Maybe TextTagTable -> IO TextBuffer |
textBufferApplyTag:: TextBufferClass tb => tb -> TextTag -> TextIter -> TextIter -> IO () |
textBufferApplyTagByName:: TextBufferClass tb => tb -> TagName -> TextIter -> TextIter -> IO () |
textBufferBeginUserAction:: TextBufferClass tb => tb -> IO () |
textBufferCreateMark:: TextBufferClass tb => tb -> Maybe MarkName -> TextIter -> Bool -> IO TextMark |
textBufferDelete:: TextBufferClass tb => tb -> TextIter -> TextIter -> IO () |
textBufferDeleteInteractive:: TextBufferClass tb => tb -> TextIter -> TextIter -> Bool -> IO Bool |
textBufferDeleteMark:: TextBufferClass tb => tb -> TextMark -> IO () |
textBufferDeleteMarkByName:: TextBufferClass tb => tb -> MarkName -> IO () |
textBufferDeleteSelection:: TextBufferClass tb => tb -> Bool -> Bool -> IO Bool |
textBufferEndUserAction:: TextBufferClass tb => tb -> IO () |
textBufferGetCharCount:: TextBufferClass tb => tb -> IO Int |
textBufferGetEndIter:: TextBufferClass tb => tb -> IO TextIter |
textBufferGetInsert:: TextBufferClass tb => tb -> IO TextMark |
textBufferGetIterAtLine:: TextBufferClass tb => Int -> tb -> IO TextIter |
textBufferGetIterAtLineOffset:: TextBufferClass tb => tb -> Int -> Int -> IO TextIter |
textBufferGetIterAtMark:: TextBufferClass tb => tb -> TextMark -> IO TextIter |
textBufferGetIterAtOffset:: TextBufferClass tb => tb -> Int -> IO TextIter |
textBufferGetLineCount:: TextBufferClass tb => tb -> IO Int |
textBufferGetMark:: TextBufferClass tb => tb -> MarkName -> IO (Maybe TextMark) |
textBufferGetModified:: TextBufferClass tb => tb -> IO Bool |
textBufferGetSelectionBound:: TextBufferClass tb => tb -> IO TextMark |
textBufferGetSlice:: TextBufferClass tb => tb -> TextIter -> TextIter -> Bool -> IO String |
textBufferGetStartIter:: TextBufferClass tb => tb -> IO TextIter |
textBufferGetTagTable:: TextBufferClass tb => tb -> IO TextTagTable |
textBufferGetText:: TextBufferClass tb => tb -> TextIter -> TextIter -> Bool -> IO String |
textBufferHasSelection:: TextBufferClass tb => tb -> IO Bool |
textBufferInsert:: TextBufferClass tb => tb -> TextIter -> String -> IO () |
textBufferInsertAtCursor:: TextBufferClass tb => tb -> String -> IO () |
textBufferInsertInteractive:: TextBufferClass tb => tb -> TextIter -> String -> Bool -> IO Bool |
textBufferInsertInteractiveAtCursor:: TextBufferClass tb => tb -> String -> Bool -> IO Bool |
textBufferInsertPixbuf:: TextBufferClass tb => tb -> TextIter -> Pixbuf -> IO () |
textBufferInsertRange:: TextBufferClass tb => tb -> TextIter -> TextIter -> TextIter -> IO () |
textBufferInsertRangeInteractive:: TextBufferClass tb => tb -> TextIter -> TextIter -> TextIter -> Bool -> IO Bool |
textBufferMoveMark:: TextBufferClass tb => tb -> TextMark -> TextIter -> IO () |
textBufferMoveMarkByName:: TextBufferClass tb => tb -> MarkName -> TextIter -> IO () |
textBufferPlaceCursor:: TextBufferClass tb => tb -> TextIter -> IO () |
textBufferRemoveAllTags:: TextBufferClass tb => tb -> TextIter -> TextIter -> IO () |
textBufferRemoveTag:: TextBufferClass tb => tb -> TextTag -> TextIter -> TextIter -> IO () |
textBufferRemoveTagByName:: TextBufferClass tb => tb -> TagName -> TextIter -> TextIter -> IO () |
textBufferSetModified:: TextBufferClass tb => tb -> Bool -> IO () |
textBufferSetText:: TextBufferClass tb => tb -> String -> IO () |
onApplyTag:: TextBufferClass tb => tb -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId tb) |
onBeginUserAction:: TextBufferClass tb => tb -> IO () -> IO (ConnectId tb) |
onChanged <no type information> |
onDeleteRange:: TextBufferClass tb => tb -> (TextIter -> TextIter -> IO ()) -> IO (ConnectId tb) |
onEndUserAction:: TextBufferClass tb => tb -> IO () -> IO (ConnectId tb) |
onInsertChildAnchor <no type information> |
onInsertPixbuf:: TextBufferClass tb => tb -> (TextIter -> Pixbuf -> IO ()) -> IO (ConnectId tb) |
onInsertText:: TextBufferClass tb => tb -> (TextIter -> String -> IO ()) -> IO (ConnectId tb) |
onMarkDeleted:: TextBufferClass tb => tb -> (TextMark -> IO ()) -> IO (ConnectId tb) |
onMarkSet:: TextBufferClass tb => tb -> (TextIter -> TextMark -> IO ()) -> IO (ConnectId tb) |
onModifiedChanged:: TextBufferClass tb => tb -> IO () -> IO (ConnectId tb) |
onRemoveTag:: TextBufferClass tb => tb -> (TextTag -> TextIter -> TextIter -> IO ()) -> IO (ConnectId tb) |
See "Text Widget Overview" in the Gtk+ docs.
The following convenience functions are omitted: gtk_text_buffer_insert_with_tags gtk_text_buffer_insert_with_tags_by_name gtk_text_buffer_create_tag gtk_text_buffer_get_bounds gtk_text_buffer_get_selection_bounds
The following functions do not make sense due to Haskell's wide character representation of Unicode: gtk_text_buffer_get_iter_at_line_index
The function gtk_text_buffer_get_selection_bounds is only used to test if there is a selection (see textBufferHasSelection).
The functionality of inserting widgets (child anchors) is not implemented since there will probably some changes before the final release. The following functions are not bound: gtk_text_buffer_insert_child_anchor gtk_text_buffer_create_child_anchor gtk_text_buffer_get_iter_at_anchor connectToInsertChildAnchor
Check textBufferGetInsert, in case there is no cursor in the editor, is there a mark called "insert"? If not, the function needs to return Maybe TextMark. The same holds for textBufferGetSelectionBound.
If Clipboards are bound, then these functions need to be bound as well: gtk_text_buffer_paste_clipboard gtk_text_buffer_copy_clipboard gtk_text_buffer_cut_clipboard gtk_text_buffer_add_selection_clipboard gtk_text_buffer_remove_selection_clipboard
Create a new text buffer, possibly taking a table of TextTag.
| textBufferNew | :: Maybe TextTagTable | :: IO TextBuffer |
| tt |
Tag a range of text.
| textBufferApplyTag | :: tb | :: TextTag | :: TextIter | :: TextIter | :: IO () |
| tb | tag | start | end |
Apply a tag that is specified by name.
| textBufferApplyTagByName | :: tb | :: TagName | :: TextIter | :: TextIter | :: IO () |
| tb | tname | start | end |
Start a new atomic user action.
| textBufferBeginUserAction | :: tb | :: IO () |
Called to indicate that the buffer operations between here and a call to textBufferEndUserAction are part of a single user-visible operation. The operations between textBufferBeginUserAction and textBufferEndUserAction can then be grouped when creating an undo stack. TextBuffer objects maintains a count of calls to textBufferBeginUserAction that have not been closed with a call to textBufferEndUserAction, and emits the "begin_user_action" and "end_user_action" signals only for the outermost pair of calls. This allows you to build user actions from other user actions. The "interactive" buffer mutation functions, such as textBufferInsertInteractive, automatically call begin/end user action around the buffer operations they perform, so there's no need to add extra calls if you user action consists solely of a single call to one of those functions.
Create a TextMark from an iterator.
| textBufferCreateMark | :: tb | :: Maybe MarkName | :: TextIter | :: Bool | :: IO TextMark |
| tb | (Just name) | iter | gravity | ||
| tb | Nothing | iter | gravity |
Pass Nothing as mark name for an anonymous TextMark.
Set gravity to True if the mark should keep left.
Delete some text but obey editable and non-editable tags.
| textBufferDeleteInteractive | :: tb | :: TextIter | :: TextIter | :: Bool | :: IO Bool |
| tb | start | end | def |
Delete a mark.
| textBufferDeleteMark | :: tb | :: TextMark | :: IO () |
| tb | tm |
This renders the TextMark tm unusable forever.
Delete a mark by name.
| textBufferDeleteMarkByName | :: tb | :: MarkName | :: IO () |
| tb | name |
The mark should exist (otherwise a nasty warning is generated).
Delete the current selection.
| textBufferDeleteSelection | :: tb | :: Bool | :: Bool | :: IO Bool |
| tb | interactive | def |
The interactive flag determines if this function is invoked on behalf of the user (i.e. if we honour editable/non-editable tags).
See textBufferInsertAtCursor for information on def.
The function returns True if a non-empty selection was deleted.
Obtain the number of characters in the buffer.
| textBufferGetCharCount | :: tb | :: IO Int |
| tb |
Note that the comment in the Gtk+ documentation about bytes and chars does not hold because Haskell uses 31-bit characters and not UTF8.
Create an iterator at the end of the buffer.
| textBufferGetEndIter | :: tb | :: IO TextIter |
| tb |
The iterator represents the position after the last character in the buffer.
Get the current cursor position.
| textBufferGetInsert | :: tb | :: IO TextMark |
| tb |
This is equivalent to liftM unJust $ textBufferGetMark "insert"
Create an iterator at a specific line.
| textBufferGetIterAtLine | :: Int | :: tb | :: IO TextIter |
| line | tb |
The line arguments must be valid.
Create an iterator at a specific line and offset.
| textBufferGetIterAtLineOffset | :: tb | :: Int | :: Int | :: IO TextIter |
| tb | line | offset |
The line and offset arguments must be valid.
Create an iterator from a mark.
| textBufferGetIterAtMark | :: tb | :: TextMark | :: IO TextIter |
| tb | tm |
Create an iterator at a specific offset.
| textBufferGetIterAtOffset | :: tb | :: Int | :: IO TextIter |
| tb | offset |
The offset arguments must be valid, starting from the first character in the buffer.
Obtain the number of lines in the buffer.
| textBufferGetLineCount | :: tb | :: IO Int |
| tb |
Retrieve a TextMark by name.
| textBufferGetMark | :: tb | :: MarkName | :: IO (Maybe TextMark) |
| tb | name |
Query if the buffer was modified.
| textBufferGetModified | :: tb | :: IO Bool |
| tb |
This flag is reset by calling textBufferSetModified.
It is usually more convenient to use onModifiedChanged.
Get a TextMark for the other side of a selection.
| textBufferGetSelectionBound | :: tb | :: IO TextMark |
| tb |
Extract text and special characters between start and end.
| textBufferGetSlice | :: tb | :: TextIter | :: TextIter | :: Bool | :: IO String |
| tb | start | end | incl |
As opposed to textBufferGetText, this function returns (chr 0xFFFC) for images, so offsets within the returned string correspond to offsets in the TextBuffer. Note the (chr 0xFFFC) can occur in normal text without images as well.
Create an iterator at the beginning of the buffer.
| textBufferGetStartIter | :: tb | :: IO TextIter |
| tb |
Extract the tag table that is associated with this text buffer.
| textBufferGetTagTable | :: tb | :: IO TextTagTable |
| tb |
Extract all the text between start and end from a TextBuffer.
| textBufferGetText | :: tb | :: TextIter | :: TextIter | :: Bool | :: IO String |
| tb | start | end | incl |
The start position is included, end is not.
If incl is True, text tagged with the invisible attribute is also returned.
Characters representing embedded images are not included. (So offsets within the returned text are different from the Buffer itself.)
Insert text at the position specified by the TextIter.
| textBufferInsert | :: tb | :: TextIter | :: String | :: IO () |
| tb | iter | str |
Insert text at the cursor.
| textBufferInsertAtCursor | :: tb | :: String | :: IO () |
| tb | str |
Insert text at the TextIter only if a normal user would be able to do so as well.
| textBufferInsertInteractive | :: tb | :: TextIter | :: String | :: Bool | :: IO Bool |
| tb | iter | str | def |
Insert the text obeying special editable or non-editable Tags.
If no tag is at the specified position, use the default value def to decide if the text should be inserted. This value could be set to the result of textViewGetEditable.
Insert text at cursor only if a normal user would be able to do so as well.
| textBufferInsertInteractiveAtCursor | :: tb | :: String | :: Bool | :: IO Bool |
| tb | str | def |
Insert an image into the TextBuffer.
| textBufferInsertPixbuf | :: tb | :: TextIter | :: Pixbuf | :: IO () |
| tb | pos | img |
See textBufferGetSlice and textBufferGetText.
Copy text between the two TextIter start and end to another location ins.
| textBufferInsertRange | :: tb | :: TextIter | :: TextIter | :: TextIter | :: IO () |
| tb | ins | start | end |
Copy text as textBufferInsertRange does, but obey editable and non-editable tags.
| textBufferInsertRangeInteractive | :: tb | :: TextIter | :: TextIter | :: TextIter | :: Bool | :: IO Bool |
| tb | ins | start | end | def |
Insert the text obeying special editable or non-editable Tags.
If no tag is at the specified position, use the default value def to decide if the text should be inserted. This value could be set to the result of textViewGetEditable.
Move a mark.
| textBufferMoveMark | :: tb | :: TextMark | :: TextIter | :: IO () |
| tb | tm | iter |
Emits "mark_set".
Move a named mark.
| textBufferMoveMarkByName | :: tb | :: MarkName | :: TextIter | :: IO () |
| tb | name | iter |
The mark should exist (otherwise a nasty warning is generated).
Place the cursor.
| textBufferPlaceCursor | :: tb | :: TextIter | :: IO () |
| tb | iter |
This is faster than moving the "insert" and the "selection_bound" marks in sequence since it avoids generating a transient selection.
Remove all tags within a range.
| textBufferRemoveAllTags | :: tb | :: TextIter | :: TextIter | :: IO () |
| tb | start | end |
Be careful with this function; it could remove tags added in code unrelated to the code you're currently writing. That is, using this function is probably a bad idea if you have two or more unrelated code sections that add tags.
Remove a tag from a range of text.
| textBufferRemoveTag | :: tb | :: TextTag | :: TextIter | :: TextIter | :: IO () |
| tb | tag | start | end |
Remove a tag from a range of text.
| textBufferRemoveTagByName | :: tb | :: TagName | :: TextIter | :: TextIter | :: IO () |
| tb | tname | start | end |
Set the "buffer-is-modified" flag.
| textBufferSetModified | :: tb | :: Bool | :: IO () |
| tb | isModified |
Replace the text in the current TextBuffer.
| textBufferSetText | :: tb | :: String | :: IO () |
| tb | str |
A TextTag was applied to a region of text.
| onApplyTag | :: tb | :: (TextTag -> TextIter -> TextIter -> IO ()) | :: IO (ConnectId tb) |
A new atomic user action is started.
| onBeginUserAction | :: tb | :: IO () | :: IO (ConnectId tb) |
Together with connectToEndUserAction these signals can be used to build an undo stack.
A range of text is about to be deleted.
| onDeleteRange | :: tb | :: (TextIter -> TextIter -> IO ()) | :: IO (ConnectId tb) |
A Pixbuf is inserted into the buffer.
| onInsertPixbuf | :: tb | :: (TextIter -> Pixbuf -> IO ()) | :: IO (ConnectId tb) |
Some text was inserted.
| onInsertText | :: tb | :: (TextIter -> String -> IO ()) | :: IO (ConnectId tb) |
| tb | user |
A TextMark within the buffer was deleted.
| onMarkDeleted | :: tb | :: (TextMark -> IO ()) | :: IO (ConnectId tb) |
A TextMark was inserted into the buffer.
| onMarkSet | :: tb | :: (TextIter -> TextMark -> IO ()) | :: IO (ConnectId tb) |
A TextTag was removed.
| onRemoveTag | :: tb | :: (TextTag -> TextIter -> TextIter -> IO ()) | :: IO (ConnectId tb) |