NAME
TUI::Editors::EditWindow - window that hosts a file editor
HIERARCHY
TObject
TView
TGroup
TWindow
TEditWindow
SYNOPSIS
use TUI::Objects;
use TUI::Editors;
my $r = TRect->new( ax => 0, ay => 0, bx => 60, by => 20 );
my $w = new_TEditWindow( $r, 'notes.txt', 1 );
$deskTop->insert( $w );
DESCRIPTION
TEditWindow is a TWindow that contains a TFileEditor together with horizontal and vertical scrollbars and an indicator. The scrollbars and the indicator are created hidden; the editor shows them when it needs them.
The window is marked as tileable and has a minimum size of 24 x 6. Its title is the file name of the editor, Untitled if the editor has no file name, or Clipboard if the editor is the clipboard. Closing the window that shows the clipboard hides it instead of closing it.
VARIABLES
The following global variables define the window titles of TEditWindow.
$clipboardTitle
The title shown for a window whose editor is the clipboard. Defaults to 'Clipboard'.
$untitled
The title shown for a window whose editor has no file name. Defaults to 'Untitled'.
ATTRIBUTES
editor
my $editor = $w->editor;
The TFileEditor contained in the window.
CONSTRUCTOR
new
my $w = TEditWindow->new(
bounds => $bounds,
fileName => $fileName,
number => $number,
);
Creates a new edit window and inserts a TFileEditor that loads the specified file.
- bounds
-
The bounds of the window (Object, a TRect).
- fileName
-
The name of the file to edit (Str or undef). An empty or undefined file name creates an untitled editor.
- number
-
The window number (Int).
new_TEditWindow
my $w = new_TEditWindow( $bounds, $fileName, $number );
Factory-style constructor using positional arguments.
This constructor is equivalent to calling new with named parameters and is provided for compatibility with traditional Turbo Vision construction patterns.
METHODS
close
$w->close;
Hides the window if its editor is the clipboard. Otherwise closes the window as TWindow does.
getTitle
my $title = $w->getTitle( $maxSize );
Returns Clipboard for the clipboard editor, Untitled for an editor without a file name, and the file name otherwise.
handleEvent
$w->handleEvent( $event );
Handles the window events as TWindow does. A cmUpdateTitle broadcast redraws the frame so that the new title is shown, and the event is cleared.
sizeLimits
$w->sizeLimits( $min, $max );
Sets the minimum size of the window to 24 x 6.
SEE ALSO
TFileEditor, TWindow, TIndicator, TScrollBar
AUTHORS
Borland International (original Turbo Vision design)
J. Schneider <brickpool@cpan.org> (Perl implementation and maintenance)
COPYRIGHT AND LICENSE
Copyright (c) 1990-1994, 1997 by Borland International
Copyright (c) 2026 the "AUTHORS" as listed above.
This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).