home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2000 May
/
Chip_2000-05_cd1.bin
/
zkuste
/
Perl
/
ActivePerl-5.6.0.613.msi
/
䆊䌷䈹䈙䏵-䞅䞆䞀㡆䞃䄦䠥
/
_77dd6dfeff5b53054adba621d46c84c5
< prev
next >
Wrap
Text File
|
2000-03-23
|
5KB
|
127 lines
<HTML>
<HEAD>
<TITLE>Tk::Reindex - change the base index of Text-like widgets</TITLE>
<LINK REL="stylesheet" HREF="../../../Active.css" TYPE="text/css">
<LINK REV="made" HREF="mailto:">
</HEAD>
<BODY>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::Reindex - change the base index of Text-like widgets</P></STRONG>
</TD></TR>
</TABLE>
<A NAME="__index__"></A>
<!-- INDEX BEGIN -->
<UL>
<LI><A HREF="#name">NAME</A></LI><LI><A HREF="#supportedplatforms">SUPPORTED PLATFORMS</A></LI>
<LI><A HREF="#synopsis">SYNOPSIS</A></LI>
<LI><A HREF="#description">DESCRIPTION</A></LI>
<LI><A HREF="#standard options">STANDARD OPTIONS</A></LI>
<LI><A HREF="#widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></LI>
<LI><A HREF="#class methods">CLASS METHODS</A></LI>
<LI><A HREF="#bugs">BUGS</A></LI>
<LI><A HREF="#author">AUTHOR</A></LI>
</UL>
<!-- INDEX END -->
<HR>
<P>
<H1><A NAME="name">NAME</A></H1>
<P>Tk::Reindex - change the base index of Text-like widgets</P>
<P>
<HR>
<H1><A NAME="supportedplatforms">SUPPORTED PLATFORMS</A></H1>
<UL>
<LI>Linux</LI>
<LI>Solaris</LI>
<LI>Windows</LI>
</UL>
<HR>
<H1><A NAME="synopsis">SYNOPSIS</A></H1>
<PRE>
use Tk::ReindexedText;
$t1=$w->ReindexedText(-linestart => 2);</PRE>
<PRE>
use Tk::ReindexedROText;
$t2=$w->ReindexedROText(-linestart => 0);</PRE>
<P>
<HR>
<H1><A NAME="description">DESCRIPTION</A></H1>
<P>Creates a new widget class based on <STRONG>Text</STRONG>-like widgets that can
redefine the line number base (normally <STRONG>Text</STRONG> widgets start line
numbers at 1), or possibly other manipulations on indexes.</P>
<P>
<HR>
<H1><A NAME="standard options">STANDARD OPTIONS</A></H1>
<P>The newly-defined widget takes all the same options as the base
widget, which defaults to <STRONG>Text</STRONG>.</P>
<P>
<HR>
<H1><A NAME="widgetspecific options">WIDGET-SPECIFIC OPTIONS</A></H1>
<DL>
<DT><STRONG><A NAME="item_Name%3A_lineStart">Name: <STRONG>lineStart</STRONG></A></STRONG><BR>
<DD>
<DT><STRONG><A NAME="item_Class%3A_LineStart">Class: <STRONG>LineStart</STRONG></A></STRONG><BR>
<DD>
<DT><STRONG><A NAME="item_Switch%3A_%2Dlinestart">Switch: <STRONG>-linestart</STRONG></A></STRONG><BR>
<DD>
Sets the line number of the first line in the <STRONG>Text</STRONG> widget. The
default <STRONG>-toindexcmd</STRONG> and <STRONG>-fromindexcmd</STRONG> use this configuration
option.
<P>-item Name: <STRONG>toIndexCmd</STRONG> <STRONG>fromIndexCmd</STRONG></P>
<P>-item Class: <STRONG>ToIndexCmd</STRONG> <STRONG>FromIndexCmd</STRONG></P>
<P>-item Switch: <STRONG>-toindexcmd</STRONG> <STRONG>-fromindexcmd</STRONG></P>
<P>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 <STRONG>Text</STRONG> widget can understand. The callback is passed the
widget followed by a list of indexes, and should return a list of
translated indexes. <STRONG>-toindexcmd</STRONG> should translate from 'user'
indexes to 'native' <STRONG>Text</STRONG>-compatible indexes, and <STRONG>-fromindexcmd</STRONG>
should translate from 'native' indexes to 'user' indexes.</P>
<P>The default callbacks simply add/subtract the offset given by the
<STRONG>-linestart</STRONG> option for all indexes in 'line.character' format.</P>
<P>It would probably be prudent to make these functions inverses of each
other.</P>
<P></P></DL>
<P>
<HR>
<H1><A NAME="class methods">CLASS METHODS</A></H1>
<DL>
<DT><STRONG><A NAME="item_import">import</A></STRONG><BR>
<DD>
To make new Reindex widgets, this function should be called via <STRONG>use</STRONG>
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.
<P></P></DL>
<P>
<HR>
<H1><A NAME="bugs">BUGS</A></H1>
<P>I've used the word ``indexes'' instead of ``indices'' throughout the
documentation.</P>
<P>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. <STRONG>Tk::Text::Contents</STRONG> comes
to mind.</P>
<P>
<HR>
<H1><A NAME="author">AUTHOR</A></H1>
<P>Andrew Allen <<A HREF="mailto:ada@fc.hp.com">ada@fc.hp.com</A>></P>
<P>This code may be distributed under the same conditions as Perl.</P>
<TABLE BORDER=0 CELLPADDING=0 CELLSPACING=0 WIDTH=100%>
<TR><TD CLASS=block VALIGN=MIDDLE WIDTH=100% BGCOLOR="#cccccc">
<STRONG><P CLASS=block> Tk::Reindex - change the base index of Text-like widgets</P></STRONG>
</TD></TR>
</TABLE>
</BODY>
</HTML>