Softpedia
 


LINUX CATEGORIES:



GLOBAL PAGES >>
NEWS ARCHIVE >>
SOFTPEDIA REVIEWS >>
MEET THE EDITORS >>
WEEK'S BEST
  • BackTrack 5 R2
  • Wine 1.4 / 1.5.5
  • Mozilla Firefox 12...
  • Ubuntu 11.04
  • Angry Birds 1.1.2.1
  • Ubuntu 10.04.4 LTS
  • Linux Kernel 3.4
  • Ubuntu Manual 10.10
  • Adobe Flash Player...
  • Pidgin 2.10.4
  • Home > Linux > Programming > Perl Modules

    Term::Visual 0.08

    Download button

    No screenshots available
    Downloads: 244  Tell us about an update
    User Rating:
    Rated by:
    NOT RATED
    0 user(s)
    Developer:

    License / Price:

    Last Updated:

    Category:
    Charles Ayres | More programs
    Perl Artistic License / FREE
    July 22nd, 2009, 06:11 GMT
    ROOT / Programming / Perl Modules

     Read user reviews (0)  Refer to a friend  Subscribe

    Term::Visual description

    Split-terminal user interface

    Term::Visual is a "visual" terminal interface for curses applications, written in Perl. It provides the split-screen interface you may have seen in console based IRC and MUD clients.

    Term::Visual uses the POE networking and multitasking framework to support concurrent input from network sockets and the console, multiple timers, and more.

    SYNOPSIS

     #!/usr/bin/perl -w
     use strict;

     use Term::Visual;

     my $vt = Term::Visual->new( Alias => "interface",
     Errlevel => 0 );

     $vt->set_palette( mycolor => "magenta on black",
     thiscolor => "green on black" );

     my $window_id = $vt->create_window(
     Window_Name => "foo",

     Status => { 0 =>
     { format => "template for status line 1",
     fields => [qw( foo bar )] },
     1 =>
     { format => "template for status line 2",
     fields => [ qw( biz baz ) ] },
     },

     Buffer_Size => 1000,
     History_Size => 50,

     Input_Prompt => "[foo] ", # Set the input prompt for the input line.
     
     Use_Title => 0, # Don't use a titlebar
     Use_Status => 0, # Don't use a statusbar

     Title => "Title of foo" );

     POE::Session->create
     (inline_states => {
     _start => &start_handler,
     got_term_input => &term_input_handler,
     }
     );

     sub start_handler {
     my $kernel = $_[KERNEL];

     # Tell the terminal to send me input as "got_term_input".
     $kernel->post( interface => send_me_input => "got_term_input" );
     
     $vt->set_status_field( $window_id, bar => $value );

     $vt->set_input_prompt($window_id, "$");

     $vt->print( $window_id, "my Window ID is $window_id" );
     }

     sub term_input_handler {
     my ($kernel, $heap, $input, $exception) = @_[KERNEL, HEAP, ARG0, ARG1];

     # Got an exception. These are interrupt (^C) or quit (^).
     if (defined $exception) {
     warn "got exception: $exception";
     exit;
     }
     $vt->print($window_id, $input);
     }

     # Only use delete_window if using multiple windows.
     $vt->delete_window( $window_id );

     $vt->shutdown;



    Product's homepage

    Requirements:

    · Perl

      


    TAGS:

    user interface | Perl interface | Perl module | split-terminal | user | interface



    HTML code for linking to this page:


    Go to top

    WindowsGamesDriversMacLinuxScriptsMobileHandheldNews

    SUBMIT PROGRAM   |   ADVERTISE   |   GET HELP   |   SEND US FEEDBACK   |   RSS FEEDS   |   UPDATE YOUR SOFTWARE   |   ROMANIAN FORUM