I think you're looking for the tk_popup() method.  

    def tk_popup(self, x, y, entry=""):
        """Post the menu at position X,Y with entry ENTRY."""
        self.tk.call('tk_popup', self._w, x, y, entry)

Here's an example of its use:
from Tkinter import *

t = Tk()
t.option_add("*Menu.tearOff", "0")
m = Menu(t) 
m.insert_command(END, label="A ...")
m.insert_command(END, label="B ...")
m.insert_command(END, label="C ...")
m.insert_command(END, label="D ...")

c = Canvas(t)
c.bind("<ButtonPress-3><ButtonRelease-3>",
        lambda e: m.tk_popup(e.x_root, e.y_root))
c.pack()

t.mainloop()

Attachment: pgpz7UGLOSJh1.pgp
Description: PGP signature

_______________________________________________
Tkinter-discuss mailing list
[email protected]
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to