finding out tags in a specified area on the canvas widget identifiedby x,y

This is a discussion on finding out tags in a specified area on the canvas widget identifiedby x,y within the TCL forums in Programming Languages category; Hi all, I am writing an application in Tk using Canvas widget. I have created some different polygons in it and tagged them using '- tags' command. Is there a way to find out what tags are there in a canvas at a specified location in the canvas say x,y. Thanks in advance! Ravikanth....

Go Back   Application Development Forum > Programming Languages > TCL

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 08-28-2008, 01:14 AM
Ravikanth
Guest
 
Default finding out tags in a specified area on the canvas widget identifiedby x,y

Hi all,

I am writing an application in Tk using Canvas widget.
I have created some different polygons in it and tagged them using '-
tags' command.

Is there a way to find out what tags are there in a canvas at a
specified location in the canvas say x,y.

Thanks in advance!

Ravikanth.
Reply With Quote
  #2  
Old 08-28-2008, 01:44 AM
Aric Bills
Guest
 
Default Re: finding out tags in a specified area on the canvas widgetidentified by x,y

On 27 août, 21:14, Ravikanth <rkanth....@gmail.com> wrote:
> Hi all,
>
> I am writing an application in Tk using Canvas widget.
> I have created some different polygons in it and tagged them using '-
> tags' command.
>
> Is there a way to find out what tags are there in a canvas at a
> specified location in the canvas say x,y.
>
> Thanks in advance!
>
> Ravikanth.


You can get the IDs for each polygon using [$canvas find overlapping
$x $y $x $y]. Once you have the IDs for each polygon, you can get
their tags using [$canvas itemcget $id -tags].
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 06:48 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.