Position a new window inside view item

I built a custom window that acts as a toolbar plugin dropdown menu, since according to this post, the SDK does not offer a dropdown menu in the toolbar plugin. So currently when a toolbar plugin is clicked, the window opens, however I need it to appear directly above the icon that was clicked to look natural. How can I position it relative to the toolbar plugin icon, so that it looks the same for any view/layout.

Is it possible to simply get the x,y coordinates of the toolbar button?

Thanks.

Unfortunately, there is no way to do it. We actually tested if we get the location of viewitem in Smart Client, we could get only location of Smart Client but no success for getting a location of viewitems.

Ok thanks. I’m just getting the cursor position which works fine.

Brilliant, I guess we were over-thinking this where you saw the easy and practical workaround.. Thanks for sharing..