O'Reilly logo

Mastering Perl/Tk by Nancy Walsh, Stephen Lidie

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Internal Debug Flag

The debug function takes an optional Boolean argument:

$text->debug( [ boolean ] );

If the value passed in is true, internal consistency checks will be turned on in the B-tree code associated with Text widgets. If false, the checks will be left off. Without any argument, the debug method will return the value "on" if it has been turned on and "off" if not. All text widgets in the application share the same debug flag.

Scanning

The scanMark and scanDragto methods are used internally in the Text widget. A call to scanMark simply records the (x, y) passed in for use later with scanDragto. It returns an empty string:

$text->scanMark(x, y);

scanDragto also takes (x, y) coordinates, which are compared to the scanMark (x, y) coordinates. The view within the Text widget is adjusted by 10 times the difference between the coordinates:

$text->scanDragto(x, y);

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required