I'm trying to implement a pop-up menu in a tree-view and am using the hitTestInfo method to determine whether to show the menu or not:

::method onTreeViewContext unguarded
  expose tree cmenu
  pos = .Point~new(x, y)                                                     
  say tree~hitTestInfo(pos)~hItem tree~hitTestInfo(pos)~location
  if tree~hitTestInfo(pos)~hItem <> 0 then cmenu~show(pos)

But the result messages from say mostly show TORIGHT or NOWHERE, even though others have appeared such as BELOW, BELOW TORIGHT, etc. Three times I managed to get the pop-up to actually show up, this was when right-clicking on the expand button of the first item in the list, but after changing the selected item I could no longer find a trigger point. I suspect something might be wrong with hitTestInfo, could that be? The fact that the menu showed up a few times IMO proves that my code is correct.