The menu display code is inbuilt to the Tk::Text widget already (you get a default popup with cut, paste...). The ->menu method allows you to replace the popup menu, but the display code remains in-built. I've re-bound the <3> right-button so I can trap where the where the even happens, turn that into a line number, and pass it to the popup command.