A code snippet used to demonstrate how to use many Tk widgets that are not available in perlTk but exist in TCL installation. As an example BLT widgets are taken, home page for BLT is http://blt.sourceforge.net/
Say, you have TCL installed that has some widgets you want to use. Here is an example:
use strict; use Tcl::Tk qw(:widgets :perlTk); my $mw = MainWindow->new; my $int = $mw->interp; $int->Eval("package require BLT;namespace import blt::*"); my $bltgraph = $int->awidget(qw/graph .g -title My_graph/); $bltgraph->pack; my $marker; $bltgraph->elementCreate(qw/line1 -symbol triangle/, -xdata=>[map{0.2*$_}0..9], -ydata=>[map{$_*$_}0..9], ); $bltgraph->markerCreate( 'window', -window => $bltgraph->Button(-text=>'Window marker',-command=>sub { $bltgraph->markerConfigure($marker, -rotate => $bltgraph->markerCget($marker,-rotate)+15); }), -coords => [1, 60], ); $bltgraph->markerCreate( 'text', -text => 'marker text', -rotate => 30, -font =>'Helvetica 30', -coords => [0.5, 60], ); $marker = $bltgraph->markerCreate( 'text', -text => 'marker text2', -rotate => -15, -font =>['Helvetica', 30], -coords => [0.5, 20], ); MainLoop;
Screenshot is available at http://home.peterstar.net/vkonovalov/BLT-tests/btl-test.jpg