TVision - Perl glue to the TurboVision library
SYNOPSIS
use TVision;
my $tapp = tnew 'TVApp';
my $w = tnew 'TWindow', [1,1,120,15], 'моё окно, товарищи',5;
my $b = tnew 'TButton', [1,1,30,3], 'кнопка', 125, 0;
my $checkboxes = tnew 'TCheckBoxes', [3,3,81,9], ['a'..'s'];
my $e = tnew TInputLine => ([3,11,81,13],100);
$tapp->deskTop->insert($w);
$w->insert($_) for ($checkboxes, $e, $b);
$e->focus();
$tapp->run;
DESCRIPTION
The TVision package is a perl glue to the TurboVision library github.com/magiblot/tvision.
TVision namespace contains subpakages of 2 types: * turbovision widgets (or 'controls') such as TButton, etc * and also some helper packages, these are: ..........
All the TVision::xxxx widgets are array refs, where first item at index 0 holds address of the underlying C++ object, 2nd ($obj->[1]) generated widget name, 3rd - its path. 4rd item - left to user, any scalar could be stored there, please see the methods store_user_value/retrieve_user_value for this.
Some widgets (TButton) has 'num' key, which is usually small integer for the onCommand event. If 0 - then next availlable is taken.
TRect is array ref of 4 integers, which isn't always blessed to TVision::TRect. TPoint is array ref of 2 integers, which isn't always blessed to TVision::TPoint. TKey is array ref of 2 integers or just integer.
Functions
Most TVision functions are mapped into perl.
$str = TVision::messageBox($str, $options);
$str = TVision::messageBoxRect([$x0,$y0,$x1,$y1],$str, $options);
$str = TVision::inputBox($title, $label, $default="", $imit=1000);
$str = TVision::inputBoxRect([$x0,$y0,$x1,$y1],$title, $label, $default="", $imit=1000);
TVision::spin_loop();
Geometry managers (not ready yet, pleae ignore this entire section)
Geometry manager tkpack stolen/hijacked from tcl/tk. In order for it to function properly, each widget gets its name ("path") TDesktop is '.', frame on it is .f, buttin on it could be named as .f.btn2, etc. Ideally widget's name is either specified by user, or generated on the fly at creation time. However we don't know who is widget's parent until it is "inserted" by the ...->insert method.
We hold widget's path in widget object, which is array ref, at item 2.
Mapping of widget names to correspoiding objects is held in %TVision::names, widget paths in %TVision::paths.