Is there a way to get the NSPanel a button is belonging to from the sender object ?
- (void)closeButtonClicked:(id)sender {
... something like [sender getPanel]...
}
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
NSButtonis anNSViewsubclass,NSViewhas a window property which gives access to theNSWindowit is in. If the button is in anNSPanelthen its window property would contain that panel (NSPanelis a subclass ofNSWindow). So something likeshould get you the panel. I would check that they are of the right kind of class for safety.