characters in a Text widget are referenced by text indexes. The parameters of the
get method are the start index and stop index (which is optional). Indexes are denoted in
line.character format. Line numbers in a Text widget start at 1, and characters on a line start at 0.
end is a special index referring to the end of the widget or line. So, for example:
my $text = $widget->get("2.0", "5.end")
means get everything from line 2, character 1 to the end of line 5 and place the content into the variable
$text.
For a more detailed explanation, refer to O'reilly's "Mastering Perl/Tk." If you are writing gui's in Perl/Tk it is a most valuable resource.
hope this helps,
davidj
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.