Josef Wolf wrote:

/ ...

> Unfortunately, this don't work as desired.  As soon as the binding to the
> object is done, the canvas binding seems to be overridden.  Even when
> right-klicking on empty space in the canvas, the object's menu is invoked.
> 
> Any ideas what I am doing wrong here?

First, rename the second menu something other than "menu" You have already
used that name, and this multiple use is causing you a lot of confusion.

Second, after a bit of experimentation, I offer this educated guess. The
rectangle object cannot process mouse events, so it cannot invoke a context
menu different from that bound to the canvas.

It is apparent that the canvas is receiving all mouse events, not the
rectangle, and in order for the rectangle to launch its own context menu,
it would have to process mouse events independently. AFAICS it can't.

I want to emphasize this is just a guess, and I don't use the 'Tk' library
because it is too poorly documented.

Have you considered using something other than 'Tk'?

-- 
Paul Lutus
http://www.arachnoid.com