Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 4677
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: jflinb [...] tsmc.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: (no value)
Fixed in: 804.027_500



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
On Mon Dec 15 04:39:42 2003, jflinb@tsmc.com wrote: Show quoted text
> 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.
> >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} >
This bug seems to be already fixed in the Tcl/Tk version (SourceForge bug 982248). I expect that the bug will also be fixed in the next Perl/Tk release. Regards, Slaven