• 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: [Q] SavePanel NSFileHandlingPanelCancelButton
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Q] SavePanel NSFileHandlingPanelCancelButton


  • Subject: Re: [Q] SavePanel NSFileHandlingPanelCancelButton
  • From: Mark de Jong <email@hidden>
  • Date: Sun, 16 Jun 2002 18:41:19 -0700

Andy,

This works perfectly. Thank you very much!

-- Mark

On Sunday, June 16, 2002, at 09:30 AM, Andy Lee wrote:

-----NSView_Utils.h-----
#import <Cocoa/Cocoa.h>

@interface NSView (Utils)

- (id)viewOfClass:(Class)aClass withTag:(int)tag;
- (id)buttonWithTag:(int)tag;

@end
-----end NSView_Utils.h-----

-----NSView_Utils.m-----
#import "NSView_Utils.h"

@implementation NSView (Utils)

- (id)viewOfClass:(Class)aClass withTag:(int)tag
{
NSEnumerator* e;
NSView* aSubview;
NSView* result;

if (([self tag] == tag) && [self isKindOfClass:aClass])
return self;

e = [[self subviews] objectEnumerator];
while ((aSubview = [e nextObject]))
if ((result = [aSubview viewOfClass:aClass withTag:tag]))
return result;

return nil;
}

- (id)buttonWithTag:(int)tag

{
return [self viewOfClass:[NSButton class] withTag:tag];
}

@end
-----end NSView_Utils.m-----

-----test code-----
NSSavePanel *panel = [NSSavePanel savePanel];
NSButton* cancelButton =
[[panel contentView] buttonWithTag:NSFileHandlingPanelCancelButton];


NSLog([cancelButton title]);
-----end test code-----
_______________________________________________
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: 
 >Re: [Q] SavePanel NSFileHandlingPanelCancelButton (From: Andy Lee <email@hidden>)

  • Prev by Date: Antialiasing an Image
  • Next by Date: Re: Printing in OSX...
  • Previous by thread: Re: [Q] SavePanel NSFileHandlingPanelCancelButton
  • Next by thread: Custom Open/Save Directory Tree
  • Index(es):
    • Date
    • Thread