Tk::TextANSIColor

Tk::Text widget with support for ANSI color escape codes
Download

Tk::TextANSIColor Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Tim Jenness
  • Publisher web site:
  • http://search.cpan.org/~tjenness/

Tk::TextANSIColor Tags


Tk::TextANSIColor Description

Tk::Text widget with support for ANSI color escape codes Tk::TextANSIColor extends the capabilities of the standard Tk::Text widget by adding support for ANSI color escape codes. When these escape codes are detected they are replaced by equivalent tags.This widget was developed to solve the problem associated with driving a scrolling status display on a GUI as well as a status display going to an Xterm without having to know whether an xterm or Tk window is receiving the status information. Mainly used in conjunction with a tied filehandle: $text = $MW->TextANSIColor->pack; tie *TEXT, "Tk::TextANSIColor", $text; $info = colored("Some information\n", 'red'); # Print information to all filehandles print TEXT $info print STDOUT $infoCurrently the Term::ANSIColor module is required in order to decode the escape codes (and probably to generate them in the first place).SYNOPSIS use Tk::TextANSIColor; $wid = $mw->TextANSIColor(?options,...?); $wid->insert($pos, $string, ?taglist, ?string, ?taglist); $string_with_escape_codes = $wid->getansi('0.0','end'); use Term::ANSIColor; $red = color('red'); # Retrieve color codes $bold = color('bold'); $wid->insert('end', "$red red text $bold with bold\n"); Requirements: · Perl


Tk::TextANSIColor Related Software