Why the menu can't stop?

I want to active a popup menu when I click the left button on one PtRaw,so I write the function code in the menu callback of the PtRaw,but it is vey strange that the menu just splashs and disappear,it can’t stop on the Ptraw,why?

Set the flags of PtRaw as Pt_MENUABLE. It may solve your problem