• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Custom window w/close
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Custom window w/close


  • Subject: Re: Custom window w/close
  • From: Andreas Mayer <email@hidden>
  • Date: Fri, 5 Mar 2004 10:39:12 +0100

Am 05.03.2004 um 00:04 schrieb Dave Hersey:

Should I be delegating mouseMoved whenever the window is open, or is there a
more system-friendly way to do the highlighting?

Use a tracking rectangle:

http://developer.apple.com/documentation/Cocoa/Conceptual/ BasicEventHandling/Tasks/HandlingMouseTracking.html

How do I get the click that activated me and make it go to my window's close
handler? Right now, the app just comes forward.

You need to return YES from the view's acceptsFirstMouse:

--------
acceptsFirstMouse:

- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent

Overridden by subclasses to return YES if the receiver should be sent a mouseDown: message for theEvent, an initial mouse-down event over the receiver in its window, NO if not. The receiver can either return a value unconditionally, or use the location of theEvent to determine whether or not it wants the event. NSViews implementation ignores theEvent and returns NO.

Override this method in a subclass to allow instances to respond to initial mouse-down events. For example, most view objects refuse an initial mouse-down event, so the event simply activates the window. Many control objects, however, such as NSButton and NSSlider, do accept them, so the user can immediately manipulate the control without having to release the mouse button.
--------


Andreas
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.


References: 
 >Custom window w/close (From: Dave Hersey <email@hidden>)

  • Prev by Date: Re: access/retrieve >5lakh records from Oracle
  • Next by Date: NSUndoManager -removeActionsWithTarget: does nothing
  • Previous by thread: Re: Custom window w/close
  • Next by thread: Help needed with NSController / Bindings problem...
  • Index(es):
    • Date
    • Thread