2

I have a typical cocoa application. There is a toolbar item on the toolbar, current behaviour is to draw a rectangle in the view of main window whenever this toolbar item is clicked.

However, now there is a new requirement: user needs to be able to drag this toolbar item to a position in the main view so that the rectangle will be drawn on that position (where user release the mouse to drop the toolbar item).

I checked the apple dev document at https://developer.apple.com/library/mac/documentation/cocoa/reference/applicationkit/classes/NSToolbarItem_Class/Reference/Reference.html and https://developer.apple.com/library/mac/documentation/cocoa/Conceptual/Toolbars/Toolbars.html#//apple_ref/doc/uid/10000109i , but cannot find any method related to this.

Could anyone know how to do it? Thanks.

Simon
  • 705
  • 1
  • 5
  • 11

0 Answers0