Sebastien Kessler wrote:
> 
> Thanks everyone for the last tips. Here's another problem. I try to
> check on the canvas if there is already an item or not (the item can be
> a simple rectangle). I try to use :
> 
>      item = self.canvas.get_item_at(event.x,event.y)
>      if item != None:
>          return TRUE
> 
> This brings a Segmentation Fault if there is nothing under
> (event.x,event.y) ! Do you know why ?
> (see the attached example which is a modified version of the
> canvas-example.py by Jesper Skov)

What do you do to get the segfault, click outside of the shape?  I tried it and
nothing happened.  What message do you get with the crash?  I think I know what
you're dealing with.

> 
> Oh, by the way, how can I check wheter this is a rectangle or an ellipse
> ? Any item.type() or so ?

Try this

    item.get_type()

It will give you an integer, but it will only work if you are over a canvas
item.  This may be related to your first problem.


Cheers.
Jeff
-- 
                   +------------------------------------+
                   |                                    |
                   |           J.W. Bizzaro             |
                   |      [EMAIL PROTECTED]       |
                   |                                    |
                   |       THE OPEN COLLABORATORY       |
                   |    FOR MOLECULAR BIOINFORMATICS    |
                   |                                    |
                   |     http://theopenlab.uml.edu/     |
                   |                                    |
                   +------------------------------------+
To unsubscribe: echo "unsubscribe" | mail [EMAIL PROTECTED]

Reply via email to