Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | |
2 | =head1 NAME | |
3 | ||
4 | Tk::TextUndo - perl/tk text widget with bindings to undo changes. | |
5 | ||
6 | =for pm Tk/TextUndo.pm | |
7 | ||
8 | =for category Derived Widgets | |
9 | ||
10 | =head1 SYNOPSIS | |
11 | ||
12 | S< >B<use Tk::TextUndo;> | |
13 | ||
14 | S< >I<$testundo> = I<$parent>-E<gt>B<TextUndo>(?I<-option>=E<gt>I<value>, ...?); | |
15 | ||
16 | =head1 DESCRIPTION | |
17 | ||
18 | This IS-A text widget with an unlimited 'undo' history but without | |
19 | a re'undo' capability. | |
20 | ||
21 | =head2 Bindings | |
22 | ||
23 | The C<TextUndo> widget has the same bindings as the L<Text|Tk::Text> widget. | |
24 | In addition there are the following bindings: | |
25 | ||
26 | =over 4 | |
27 | ||
28 | =item Event <L4> <<Undo>> | |
29 | ||
30 | undo the last change. Pressing <L4> several times undo | |
31 | step by step the changes made to the text widget. | |
32 | ||
33 | =back | |
34 | ||
35 | =head2 Methods | |
36 | ||
37 | The C<TextUndo> widget has the same methods as C<Text> widget. | |
38 | Additional methods for the C<TextUndo> widget are: | |
39 | ||
40 | =over 4 | |
41 | ||
42 | =item $text->Load($filename); | |
43 | ||
44 | Loads the contents of the $filename into the text widget. Load() | |
45 | delete the previous contents of the text widget as well as it's | |
46 | undo history of the previous file. | |
47 | ||
48 | =item $text->Save(?$otherfilename?) | |
49 | ||
50 | Save contents of the text widget to a file. If the | |
51 | $otherfilename is not specified, the text widget contents | |
52 | writes the file of $filename used in the last Load() | |
53 | call. If no file was previously Load()'ed an error message | |
54 | pops up. The default filename of the last Load() call | |
55 | is not overwriten by $otherfilename. | |
56 | ||
57 | =item $text->FileName(?$otherfilename?) | |
58 | ||
59 | If passed an argument sets the file name associated with the loaded | |
60 | document. Returns the current file name associated with the document. | |
61 | ||
62 | =back | |
63 | ||
64 | =head1 KEYS | |
65 | ||
66 | widget, text, undo | |
67 | ||
68 | =head1 SEE ALSO | |
69 | ||
70 | L<Tk::Text>, L<Tk::ROText> | |
71 | ||
72 | =cut | |
73 |