HList
![Nota Nota](https://perlenespanol.com/foro/styles/prosilver/imageset/icon_post_target.gif)
Hola a todos, primero mis mas sentido pesames para familiares y amigos de nuestro Genio.
Necesito saber como trabjar con Hlist??
Tengo este codigo, corre perfecto, ahora no se come meter valores desde variables en las diferentes columnas y filas de este hlist, Me pueden ayudar..
Gracias................
Necesito saber como trabjar con Hlist??
Tengo este codigo, corre perfecto, ahora no se come meter valores desde variables en las diferentes columnas y filas de este hlist, Me pueden ayudar..
Gracias................
Using perl Syntax Highlighting
use Tk;
use Tk::HList;
use Tk::Scrollbar;
sub icmd {
my ($path, $state) = @_;
print "path is '$path', state is '$state'\n";
}
my $mw = MainWindow->new;
$hlist = $mw->HList(-columns => 4, -header => 1)
->pack(-expand => 1, -fill => 'both');
$hlist->headerCreate(0, -text => "Color Name");
$hlist->headerCreate(1, -text => "Red value");
$hlist->headerCreate(2, -text => "Green value");
$hlist->headerCreate(3, -text => "Blue value");
foreach (qw/orange red green blue purple/) {
my ($r, $g, $b) = $mw->rgb($_);
$hlist->add($_);
$hlist->itemCreate($_, 0, -text => "HOLA");
$hlist->itemCreate($_, 1, -text => sprintf "%#x", $r);
$hlist->itemCreate($_, 2, -text => sprintf "%#x", $g);
$hlist->itemCreate($_, 3, -text => sprintf "%#x", $b);
}
MainLoop;
use Tk::HList;
use Tk::Scrollbar;
sub icmd {
my ($path, $state) = @_;
print "path is '$path', state is '$state'\n";
}
my $mw = MainWindow->new;
$hlist = $mw->HList(-columns => 4, -header => 1)
->pack(-expand => 1, -fill => 'both');
$hlist->headerCreate(0, -text => "Color Name");
$hlist->headerCreate(1, -text => "Red value");
$hlist->headerCreate(2, -text => "Green value");
$hlist->headerCreate(3, -text => "Blue value");
foreach (qw/orange red green blue purple/) {
my ($r, $g, $b) = $mw->rgb($_);
$hlist->add($_);
$hlist->itemCreate($_, 0, -text => "HOLA");
$hlist->itemCreate($_, 1, -text => sprintf "%#x", $r);
$hlist->itemCreate($_, 2, -text => sprintf "%#x", $g);
$hlist->itemCreate($_, 3, -text => sprintf "%#x", $b);
}
MainLoop;
Coloreado en 0.003 segundos, usando GeSHi 1.0.8.4