Re: finding out tags in a specified area on the canvas widget identified by x,y



On 27 août, 21:14, Ravikanth <rkanth....@xxxxxxxxx> 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].
.



Relevant Pages

  • Re: creating GUI of lines
    ... canvas boundaries, the lines are discontinuous. ... when we configure the widget, i need to change the line ... etc, is just to use a single text widget, and text tags to identify ...
    (comp.lang.tcl)
  • Re: XOR drawing on Tk canvas?
    ... >>with Tk's canvas than you could with bitmaps and XOR. ... >>use these tags to refer to the items on the canvas. ... on all pieces say, NORMAL or HIGHLIGHT, as well as indiviauald tags N7 & H7) ...
    (comp.lang.tcl)
  • Re: WxInter
    ... all things a tk canvas can do very easily... ... or on a group of items via tags. ... ## Event binding on several objects grouped via a tag ... automatically the bindings created on its tag. ...
    (comp.lang.python)
  • Re: selecting a good background color
    ... With busy data, it can easy have 2 to 3 thousand items. ... I think all of my canvas items have at ... I use tags extensively also. ... the tags represent a geometry ...
    (comp.lang.tcl)
  • Re: WxInter
    ... >>individually, or group them with tags, or knowing which items are at a ... all things a tk canvas can do very easily... ... your own app. ... Check out my FloatCanvas for wxPython: ...
    (comp.lang.python)