man Gtk2::Ex::HyperTextBuffer () - A TextBuffer for the HyperTextView widget
NAME
HyperTextBuffer - A TextBuffer for the HyperTextView widget
DESCRIPTION
This module is a subclass of Gtk2::TextBuffer intended for use with Gtk2::Ex::HyperTextView. It has a high level interface that uses parse trees instead of plain text. It also keeps an undo-/redo-stack.
HIERARCHY
Glib::Object +----Gtk2::TextBuffer +----Gtk2::Ex::HyperTextBuffer
METHODS
Simple constructor. Deletes all buffer contents. Be aware that this module sometimes stores a reference to the buffer in a global variable in order to get copy-pasting with mark up work. This means you could save a lot of memory when you always clear the object when you are done with it. Initialise pre-defined text tags. See TAGS for a listing of these tags. Load the buffer with contents from a parse tree. The tree format is based on the format as used by Pod::Simple but it uses more verbose element names. For example:
['Document', {}, ['head1', {}, 'Test page'], "\n\n", "This is a test page showing some syntax:\n\n", ['bold', {}, 'Bold text'], "\n", ['italic', {}, 'Italic text'], "\n", ['bold', {}, ['italic', {}, 'Bold and Italic'] ], "\n", ]TODO: add a second method to load Pod::Simple parse trees directly Insert one or more partial parse trees in the buffer at ITER. Like CWinsert_blocks() but inserts at current cursor position. Insert an image in the buffer at the cursor. Returns a parse tree based on the buffer contents. Returns an anonymous Gtk2::TextIter that holds LINK_DATA. LINK_DATA should be an array reference. The first item in this array should be a boolean descibing whether the link matches the text it is applied to. If this boolean is set to tru the second element in the array will be update to hold the text if the buffer is edited. Every link tag should only be applied to one text region. TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO TODO
TAGS
Tags are used in Gtk2::TextBuffer to render certain parts of the text buffer with a certain colours or certain decorations. In Gtk2::Ex::HyperTextBuffer they also represent a node in the document parse tree. See Gtk2::TextTag for more details.
The following tags are pre-defined:
- head1
- head2
- head3
- head4
- head5
- bold
- italic
- underline
- verbatim
- Verbatim
- Like 'verbatim' but intended for multiline blocks.
- link
- For links anonymous TextTags are used, but the visual properties are defined the same way as for other tags.
AUTHOR
Jaap Karssenberg (Pardus) <pardus@cpan.org>
Copyright (c) 2005 Jaap G Karssenberg. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.