hello,
i am using perl 5.22 with tkx on Windows 10.
with tk, i succeed to bind buttonrelease-1 to a new_tk__listbox.
but with tkx i do not succeed to bind the button to a new_tkx_Scrolled("listbox".
that is to say, when i clic, Nothing happens.
if somebody can look at this problem, that would be very fine for me, thanks by qadvance.
here is my little test program.
use Tkx;
use Tkx::Scrolled;
use strict;
my $lbox;
my $mw= Tkx::widget->new(".");
$mw->g_wm_minsize(200,200);
$mw->g_wm_resizable(1,1);
$mw->g_wm_focus();
display_main();
Tkx::MainLoop;
sub clic
{
#$box_value=$sous_lbox2->get($sous_lbox2->curselection());
my $val=$lbox->curselection();
print "val=$val\n";
return if ($val eq "");
my $value=$lbox->get($lbox->curselection());
print "$value\n";
}
sub display_main
{
# $lbox=$mw->new_tk__listbox(-height=>5,-selectmode => "single");
$lbox=$mw->new_tkx_Scrolled("listbox",-scrollbars=>"se",-height=>5,-
+selectmode => "single");
$lbox->g_pack(
-anchor=>'n', -padx=>3, -pady=>3, -expand=>1, -fill=>'both');
foreach my $key ("aa","bb","cc")
{
$lbox->insert('end', "$key- ");
}
$lbox->g_bind('<ButtonRelease-1>' , sub { clic() });
}