Subject: | Tk Canvas itemconfigure issue |
Date: | Mon, 15 Dec 2003 09:39:38 +0000 |
To: | bug-Tk [...] rt.cpan.org |
From: | jflinb [...] tsmc.com |
Dear Nick,
This is JFLinb from tsmc.
Looking for the Tk resource to eliminate my doubts on some Tk syntax
usages, I call on your homepage
and find you have ever been an employe of TI. I appreciate your
excellent contribution to Tk and wonder to
ask a favor. Here are the problem description : Tk8.0 (perl5.8.0)
I use "itemconfigure" to switch the visibility of some canvas window
"item" by '-state' option, but it failed.
Show quoted text
>From the screen print, the "state" has been "hidden", but the window item
"id" is still visible on the canvas.
Strangely, if directly call for the callback (not through subroutine), I
can hide the window item.
.......................
$canvas -> createRectangle($lx,$oy-1,$ux,$uy,-fill => 'IndianRed'
,-outline => 'IndianRed', -tags=>'rect');
$id = $canvas ->Label(-text => "$row[1]", -bg=>"DeepSkyBlue1", -fg
=>"white", -relief=>'raised', -borderwidth=>2, -font => "arial 10 bold");
$canvas ->createWindow($lx,$uy-2, -window => $id, -anchor =>'
sw', -state => 'normal', -tags=>"id");
$canvas -> CanvasBind("rect", "<Enter>",\&aa);
sub aa {
$canvas -> itemconfigure("id", -state=>'hidden');
print $canvas -> itemcget("id", -state), "\n";
return}
Regards,
JF