Nov 8, 2001, 3:04 AM
Post #2 of 2
I hope this is still useful, even though your post is rather old ...
Tk::Text widgets support a feature called 'Tags', which are formats that you can apply to parts of the Text's contents. Simply define a tag with the properties you need, and apply the tag to the currently selected text:
You can insert text by calling the insert(position, text) function. position can be 'end', 'linenumber.charnumber', ...
$TEXT->tagConfigure('arial', -font => 'Arial');
$TEXT->tagAdd('arial', 'sel.first', 'self.last') if $TEXT->tagRanges('sel');