How can I get the on-screen location of a toolbar button? It turns out the rectangle of the rectangle NSToolbarItem? It seems that the method [NSToolbarItem view]always returns nilwhen the toolbar item is a simple action button, and therefore I could not use the usual methods NSViewto pinpoint the position of the toolbar on the screen.
NSToolbarItem
[NSToolbarItem view]
nil
NSView
Background
I am trying to use the Matt Gemmell component MAAttachedWindowto point to a specific toolbar button. The component requires that the object NSPoint"point" the user to a location on the screen.
MAAttachedWindow
NSPoint
Thanks in advance.
. , , , ... ToolbarItem - . :
- (IBAction)showOverlay:(id)sender { NSPoint clickedPoint = [self.window mouseLocationOutsideOfEventStream]; self.overlayController = [[MyOverlayController alloc] initAtPoint:clickedPoint]; }
Source: https://habr.com/ru/post/1739817/More articles:Working on Peano's axioms in Agda and hitting a piece of point - haskellredis timeout with predis - redisPython socket error while receiving UDP data. (10054) - pythonUDP Hole Punching (C ++ / winsock) - c ++What is a browser-based way to capture all clicks with the click of a button? - javascriptWhat is the difference between search plugins and other full-text plugins? - ruby-on-railsDifference in visual state and triggers - wpfСтранное использование индекса в Mysql - sqlPrintable DataTable Google Visualizations - javascriptto load Javascript object from file - jqueryAll Articles