1

I create NSToolbar and added NSView on the NSToolbar. NSView Included NSImageView.

When clicked NSImageView or NSView in NSToolbar, I can't moved application. How can I move application when I clicked NSView (or NSImageView) on the NSToolbar.

Justin Boo
  • 10,132
  • 8
  • 50
  • 71
kimgyver
  • 11
  • 2

1 Answers1

1

The question isn't very clear to me, but if you want to move the window with the mouse you could subclass the NSView (or NSImageView) and add

- (BOOL)mouseDownCanMoveWindow {
    return YES;
}
nielspl
  • 181
  • 3
  • Thank your answer.but it' doesn't work. When I clicked NSToolbar, I can move main window. but when I clicked NSView on NSToolbar, I can't . – kimgyver Dec 07 '10 at 12:48
  • Are you sure you are subclassing the NSImageView, because the method I described here works for me? Override the draw function to test it. - (void)drawRect:(NSRect)dirtyRect { [[NSColor yellowColor] set]; NSRectFill(dirtyRect); } – nielspl Dec 07 '10 at 13:55
  • I will test again about this problem. Thank you. – kimgyver Dec 08 '10 at 02:50