Correction: as I added the ::method and expose lines afterwards while
composing my note I forgot to include the arg statement, so the sample code
I use is therefore:
:method onTreeviewContext unguarded
expose tree cmenu
use arg hwnd, x, y
pos = .Point~new(x, y)
say tree~hitTestInfo(pos)~hItem tree~hitTestInfo(pos)~location
if tree~hitTestInfo(pos)~hItem <> 0 then cmenu~show(pos)
On Fri, Sep 28, 2012 at 7:59 PM, Staffan Tylen <staffan.ty...@gmail.com>wrote:
> 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.
>
> Staffan
>
>
------------------------------------------------------------------------------
Got visibility?
Most devs has no idea what their production app looks like.
Find out how fast your code is with AppDynamics Lite.
http://ad.doubleclick.net/clk;262219671;13503038;y?
http://info.appdynamics.com/FreeJavaPerformanceDownload.html
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users