Skip to content

brickpool/TUI-Vision

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

466 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

NAME

TUI::Vision - Turbo Vision inspired TUI framework for Perl

SYNOPSIS

package MyApp;

use Moo;
use TUI::Objects;
use TUI::App;
use TUI::Menus;
use TUI::Dialogs;
use TUI::Views;

extends TApplication;

use constant {
  cmAbout => 1001,
};

sub initMenuBar {
  my ( $class, $r ) = @_;
  $r->{b}{y} = $r->{a}{y} + 1;
  return TMenuBar->new(
    bounds => $r,
    menu   => new_TSubMenu('~A~pp', kbAltA)
              + new_TMenuItem('~A~bout...', cmAbout, kbNoKey)
              + newLine()
              + new_TMenuItem('E~x~it', cmQuit, kbAltX)
  );
}

sub handleEvent {
  my ( $self, $event ) = @_;
  $self->SUPER::handleEvent($event);
  return unless $event->{what} == evCommand;
  return unless $event->{message}{command} == cmAbout;

  my $dialog = TDialog->new(
    bounds => TRect->new( ax => 20, ay => 6, bx => 60, by => 15 ),
    title  => 'About'
  );
  $dialog->insert(
    TStaticText->new(
      bounds => TRect->new( ax => 3, ay => 3, bx => 35, by => 5 ),
      text   => 'Hello from TUI::Vision'
    )
  );
  $dialog->insert(
    TButton->new(
      bounds  => TRect->new( ax => 14, ay => 7, bx => 26, by => 9 ),
      title   => '~O~K',
      command => cmOK,
      flags   => bfDefault
    )
  );

  $deskTop->execView($dialog);
  $self->destroy($dialog);
  $self->clearEvent($event);
  return;
}

package main;
my $app = MyApp->new();
$app->run();

DESCRIPTION

TUI::Vision is the successor namespace to the TV:: module family. It provides a Perl port of the classic Turbo Vision framework. This distribution currently contains namespace stubs for all major subsystems. These stubs reserve the API surface and document the intended architecture for the upcoming full implementation.

The goal of TUI::Vision is to provide a complete, modular, and portable text user interface framework for Perl, including:

All modules in this release are placeholders. They contain no functional code and no dependencies. Their purpose is to establish the namespace structure and documentation for the upcoming migration of the existing TV:: implementation.

STATUS

This distribution is under active development. Modules are added as stubs first, then filled with functionality in subsequent releases.

AUTHORS

Turbo Vision Development Team
J. Schneider <brickpool@cpan.org>

COPYRIGHT AND LICENSE

Copyright (c) 1990-1994, 1997 by Borland International

Copyright (c) 2021-2026 the "AUTHORS" and /CONTRIBUTORS as listed in the sources.

This software is licensed under the MIT license (see the LICENSE file, which is part of the distribution).

About

Turbo Vision is a character-mode text user interface framework.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages