GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  TK::REINDEX (3)

.ds Aq ’

NAME

Tk::Reindex - change the base index of Text-like widgets

CONTENTS

SYNOPSIS



    use Tk::ReindexedText;
    $t1=$w->ReindexedText(-linestart => 2);

    use Tk::ReindexedROText;
    $t2=$w->ReindexedROText(-linestart => 0);



DESCRIPTION

Creates a new widget class based on <B>TextB>-like widgets that can redefine the line number base (normally <B>TextB> widgets start line numbers at 1), or possibly other manipulations on indexes.

STANDARD OPTIONS

The newly-defined widget takes all the same options as the base widget, which defaults to <B>TextB>.

WIDGET-SPECIFIC OPTIONS

Name: <B>lineStartB>
Class: <B>LineStartB>
Switch: <B>-linestartB> Sets the line number of the first line in the <B>TextB> widget. The default <B>-toindexcmdB> and <B>-fromindexcmdB> use this configuration option.

-item Name: <B>toIndexCmdB> <B>fromIndexCmdB>

-item Class: <B>ToIndexCmdB> <B>FromIndexCmdB>

-item Switch: <B>-toindexcmdB> <B>-fromindexcmdB>

These two options specify callbacks that are called with a list of indexes and are responsible for translating them to/from indexes that the base <B>TextB> widget can understand. The callback is passed the widget followed by a list of indexes, and should return a list of translated indexes. <B>-toindexcmdB> should translate from ’user’ indexes to ’native’ <B>TextB>-compatible indexes, and <B>-fromindexcmdB> should translate from ’native’ indexes to ’user’ indexes.

The default callbacks simply add/subtract the offset given by the <B>-linestartB> option for all indexes in ’line.character’ format.

It would probably be prudent to make these functions inverses of each other.

CLASS METHODS

import To make new Reindex widgets, this function should be called via <B>useB> with the name of the Text-like base class that you are extending with Reindex capability. ’use base(Tk::Reindex Tk::nameofbasewidget)’ should also be specified for that widget.

BUGS

I’ve used the word indexes instead of indices throughout the documentation.

All the built-in perl code for widget bindings & methods will use the new ’user’ indexes. Which means all this index manipulation might might break code that is trying to parse/manipulate indexes. Or even assume that ’1.0’ is the beginning index. <B>Tk::Text::ContentsB> comes to mind.

AUTHOR

Andrew Allen <ada@fc.hp.com>

This code may be distributed under the same conditions as Perl.

Search for    or go to Top of page |  Section 3 |  Main Index


Tk1.1 REINDEX (3) 2013-11-15

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.