Skip to Main Content
Learning Perl/Tk
book

Learning Perl/Tk

by Nancy Walsh
January 1999
Beginner content levelBeginner
373 pages
9h 43m
English
O'Reilly Media, Inc.
Content preview from Learning Perl/Tk

8.13. Getting Line Information

The dlineinfo method returns a list of five items. These items describe the area of the line that contains index:

  • X coordinate of the upper-left corner

  • Y coordinate of the upper-left corner

  • Width of the area

  • Height of the area

  • Baseline position of the line, measured from x

Here is an example call:

($x, $y, $w, $h, $base) = $text->lineinfo("index");

Unlike the bboxmethod, even areas not shown (due to nonwrapped characters) are used in the calculations as long as some of the line is showing. However, if the line is not visible at all on the screen, the list will be empty. If the line happens to wrap to multiple lines, the entire area is used.

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Mastering Perl/Tk

Mastering Perl/Tk

Stephen Lidie, Nancy Walsh

Publisher Resources

ISBN: 1565923146Supplemental ContentCatalog PageErrata